apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Orton <jor...@btconnect.com>
Subject Re: GCC 2.96 optimization bug
Date Sun, 24 Jun 2001 09:34:26 GMT
On Sun, Jun 24, 2001 at 01:09:11AM -0700, Justin Erenkrantz wrote:
> On Sat, Jun 23, 2001 at 07:42:28PM -0700, Justin Erenkrantz wrote:
> > I just ran across a compiler bug when dealing with long long in the GCC
> > shipped with Mandrake 8.0 (Intel).  When -O2 is specified (it's in the
> > default), it seems to lose the upper 32 bits of the 64 bit integers.
> > (I was playing with the XML code in apr-util and the return values from
> > elem_size() were corrupted.)  Removing -O2 fixes this.

I can't seem to find where 64-bit integers are used in the XML code?  
elem_size uses size_t everywhere AFAICT, I guessed you mean Intel x86?

> FWIW (and as expected), GCC 3.0 doesn't exhibit this problem with the
> -O2 flags set.
>
> Any thoughts as to what we should do?  It is a buggy compiler, but a
> fairly popular "stable" Linux distro has this compiler installed by 
> default.  I believe (at one point) RH 7 included GCC 3.0 CVS 
> snapshots.  I wonder if other distributions are affected by this 
> problem.

The Mandrake gcc package follows the Red Hat Linux gcc package (plus
extra bits). From looking at the spec files it looks like your MDK8.0
gcc has the patches from the RHL7.1 gcc. Can you post code and I can try
to reproduce it on 7.1?

> And, it looks like the -O2 flag is coming from the autoconf distribution
> itself (/usr/share/autoconf/acspecific.m4).  So, this doesn't look
> directly configurable in our autoconf scripts (unless we replace
> AC_PROG_CC).  -- justin

Well you could sed it out after the AC_PROG_CC is used if it proves
necessary (CFLAGS="`echo $CFLAGS | sed s/-O2//g`")

Regards,

joe


Mime
View raw message