DragonFly kernel List (threaded) for 2007-11
DragonFly BSD
DragonFly kernel List (threaded) for 2007-11
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: GCC-4 compiler bug


From: "Simon 'corecode' Schubert" <corecode@xxxxxxxxxxxx>
Date: Wed, 28 Nov 2007 01:00:26 +0100

Matthew Dillon wrote:
    GCC-4.1.2 is not properly handling signed 64 bit rollovers.  It's
    not doing it properly for 32 bit rollovers either.

This program should generate an "X" when run. It doesn't.

Yea, it seems that GCC 4 started to exploit the C99 standard which says that signed integer overflows are undefined. This is a nasty thing and comes unexpected for many programmers and existing source.


Important to note is that this only happens when compiling with optimization (they claim). This is even worse than this happening all the time, IMO.

We have two choices here: "fix" code so that it doesn't rely on signed integer overflows or hack gcc so that it won't do this one particular optimization.

Now I would be inclined to say that gcc should behave, but on the other hand I can't really see applications to this *except for checking integer overflows in the first place*.

Opinions?

cheers
 simon

--
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   / \



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]