> > > > With no optimization the program runs correctly by the rules of integers > > representation in memory. See the explanation below. > > > > I must have been asleep last night :} Thanks Alexei! > > gcc-3.1 generates similar code, don't have 3.2 on an i386 box > to test. Though 3.2 on an hppa box produces a condition check > even when at -O9 so other arches _do_ have it correct. >
Just to clarify, 3.1.1 does not have these fixes as per... Reading specs from /usr/lib/gcc-lib/i386-linux/3.1.1/specs Configured with: /mnt/data/gcc-3.1/gcc-3.1-3.1.1ds2/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/g++-v3-3.1 --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --enable-clocale=gnu --enable-__cxa_atexit --enable-threads=posix --enable-java-gc=boehm --enable-objc-gc i386-linux Thread model: posix gcc version 3.1.1 20020703 (Debian prerelease) Changes occured between July 3rd and now? c.