Compiler bug....
dirk.derycke@icos.be
dirk.derycke@icos.be
Fri Oct 29 04:54:00 GMT 1999
I have the following strange error that occurs when compiling WITHOUT
optimizations
const unsigned short shift = 32;
unsigned int res;
res = 1 << shift;
normally this fragment should cause an overflow and res should become zero
but
without optimizations
res = 1;
the 1 bit seems to roll over and enters in the least significant bit
with optimizations
res = 0
(optimizer determines the CORRECT value at compile time)
Compiler version: 2.95.2
Platform : i686-pc-linux-gnu
I added the problem program with its makefile to this mail
regards,
Dirk De Rycke
dirk.derycke@icos.be
(See attached file: Makefile)(See attached file: shift.c)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 114 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19991029/b9328bc2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shift.c
Type: text/x-c
Size: 136 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-bugs/attachments/19991029/b9328bc2/attachment-0001.bin>
More information about the Gcc-bugs
mailing list