[Bug c/24756] pointer arithmetic on ia32 uses signed divide

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed Nov 9 17:30:00 GMT 2005



------- Comment #5 from pinskia at gcc dot gnu dot org  2005-11-09 17:30 -------
This is invalid because otherwise you get the incorrect answer for &a[3]-&a[4]:
 a = 0x8049668 b = 0x804966c
pointer         ( a - b )                                              
0xffffffff
non-pointer     ( ( ((unsigned long)a) - ((unsigned long)b) ) / 4)     
0x3fffffff


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24756



More information about the Gcc-bugs mailing list