GCC-4 compiler bug
Simon 'corecode' Schubert
corecode at fs.ei.tum.de
Wed Nov 28 15:24:51 PST 2007
Matthew Dillon wrote:
I was rather surprised that the compiler barfed on that code. That code
was, in fact, explicitly testing for an overflow. Regardless of what
C99 says, it would be ultra stupid for any compiler to stray outside of
the type's width.
Yes, I think it is stupid. But I don't think that any newer GCC version fixes this. We'll probably have to change GCC not to include this optimization. Mind you that this happens only for signed overflows. Unsigned overflow should still work as we expect.
Serve - BSD +++ RENT this banner advert +++ ASCII Ribbon /"\
Work - Mac +++ space for low â¬â¬â¬ NOW!1 +++ Campaign \ /
Party Enjoy Relax | http://dragonflybsd.org Against HTML \
Dude 2c 2 the max ! http://golden-apple.biz Mail + News / \
More information about the Kernel