g++-3.4 bug

Richard Guenther rguenther at suse.de
Mon Feb 20 20:48:41 CET 2012


On Mon, 20 Feb 2012, Marc Glisse wrote:

> On Mon, 20 Feb 2012, Richard Guenther wrote:
> 
> > On Thu, 16 Feb 2012, Marc Glisse wrote:
> > 
> > > Hello,
> > > 
> > > some tests currently fail on gmpxx with g++-3.4 (on shell). This is due to
> > > a
> > > bug in g++-3.4, which for l=2 says the following is true:
> > > __builtin_constant_p(l) && (l == 0)
> > > it is interesting to insert a printf statement that prints both l and l==0
> > > and
> > > have it print 2 and true :-/
> > 
> > Not for me.
> > 
> > int main () { int l = 2; if (__builtin_constant_p (l) && (l == 0)) return
> > 1; return 0; }
> 
> Did you try getting a snapshot of the gmp repos and running the c++ testsuite?
> Yes, your simple example passes, but you know better than I do how much the
> context matters for optimizations. And since the bug doesn't seem reproducible
> with more recent versions of gcc, there is little motivation to reduce the
> failing tests.

Ah, ok - I thought you might have one.  I'm not really interested in
GCC 3.4.x bugs either - after all this version has been out of 
maintainance for six years...

> The failing compiler was 3.4.6, from ports on freebsd 8.1, with -O2 -m64.
> 4.2.5 seems good.

... has have 4.2.x and 4.3.x.  But it seems freebsd is stuck with 4.2.2,
the last release with GPLv2.  I suppose for freebsd testing should focus
on LLVM.

Richard.


More information about the gmp-devel mailing list