Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 5b69dc59e10f8995f51d8a709fedd72dbb2dc1ec
Ticket: 1571954fffffffffffffffffffffffffffffffff
Xeon64 data loss from casting
User & Date: andersmoe on 2006-10-06 07:29:42
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    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.
    
    
  4. foundin changed to: "obsolete: 8.4.14"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "andersmoe"
  10. subsystem changed to: "52. Portability Support"
  11. title changed to: "Xeon64 data loss from casting"
  12. type changed to: "Bug"