|
2006-10-06
| ||
| 21:16 | • Closed ticket [1571954fff]: Xeon64 data loss from casting plus 7 other chang... artifact: 58223f549b user: patthoyts | |
| 18:15 | • Ticket [1571954fff]: 4 changes artifact: da7bf8a5c5 user: patthoyts | |
| 14:30 | • Ticket [1571954fff]: 1 change artifact: 566070b2f8 user: andersmoe | |
| 14:29 | • Ticket [1571954fff]: 4 changes artifact: fd702f2bc6 user: andersmoe | |
| 14:29 | • Add attachment tclCompile.c to ticket [1571954fff] artifact: 8181164b6b user: andersmoe | |
| 07:29 | • New ticket [1571954fff] Xeon64 data loss from casting. artifact: 5b69dc59e1 user: andersmoe | |
Xeon64 data loss from casting
Closed / Fixed1571954fffffffffffffffffffffffffffffffffCreated 20 years agoUpdated 20 years ago
Descriptionplain2006-10-06 07:29:42
Tcl version : core-8-4-branch
makefile.vc version : 1.100.2.9
generic/tclCompile.h : 1.33
Compiler : MSVC 8.0
processor : Xeon 64 EMT64
Windows XP 64
When running Tcl, I get the following :
----------------
Run-Time Check Failure #1 - A cast to a smaller data
type has caused a loss
of data. If this was intentional, you should mask
the source of the cast
with the appropriate bitmask. For example:
char c = (i & 0xFF);
Changing the code in this way will not affect the
quality of the resulting
optimized code.
--------------
pointing to TclStoreInt4AtPtr and similar macros.
the problem seems to disappear if I change, say,
TclStoreInt4AtPtr to
#define TclStoreInt4AtPtr(i, p) \
*(p) = (unsigned char) (0xFF & ((unsigned int)
(i) >> 24)); \
*(p+1) = (unsigned char) (0xFF & ((unsigned int)
(i) >> 16)); \
*(p+2) = (unsigned char) (0xFF & ((unsigned int)
(i) >> 8)); \
*(p+3) = (unsigned char) (0xFF & ((unsigned int)
(i)))
This also applies to TclEmitInstInt4.
I've attached the tclCompile.h I ended up with.
Note that I have not done any testing to smoke out
any bugs that may have resulted from the above
modifications.
andersmoeplain2006-10-06 14:29:42
File Added - 196838: tclCompile.c
andersmoe Ticket [1571954fff]: 1 change
[History diff]2006-10-06 14:30:07
patthoytsplain2006-10-06 18:15:22
Logged In: YES user_id=202636 This is likely caused by including the /RTCc flag which enables this runtime type conversion check. In Tcl this is not an error so the solution is to remove this compiler flag from makefile.vc. We shall keep /RTC1 which enables runtime stack checking and uninitialized variable checking.
patthoytsplain2006-10-06 21:16:15
Logged In: YES user_id=202636 Committed the removal of /RTCc for Tcl in both HEAD and core-8-4-branch. I'll close the bug - please re-open if this fails to solve the issue.
Log in (anonymous is fine) to add a comment.
Attachments:
- tclCompile.c [download] added by andersmoe on 2006-10-06 14:29:42. [details]