This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/66077] Right shift calculation error


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66077

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Your X and Y are not correctly displaying.

The correct values are:
x = 0xF12B3740
y = 0x1F12B3740


You should be using %lX rather than %X to display unsigned long.

Like:
   printf("x = 0x%lX\n", x);
   printf("y = 0x%lX\n", y);

As you can see there is another bit set in the upper 32bits which causes the
difference.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]