GMP 4.1.3 - t-cmp_si fails on x86_64
Schoeller Porter
schoeller_porter at yahoo.com
Thu Jul 15 18:38:56 CEST 2004
> > Relevant info from the RHEL3 system:
> > gcc version 3.2.3 20030502 (Red Hat Linux 3.2.3-34)
> >
> > Relevant info from the Suse 9.1 machine (where there is no problem):
> > gcc version 3.3.3 (SuSE Linux)
>
> We've had joy from gcc 3.3 too. I'd suspect a compiler bug if it
> seems confined to 3.2.
>
> > mpf_cmp_si wrong on data[6]
> > a=-0.1e1 (-1)
> > b=1 (1)
> > got=0
> > want=-1
>
> That should be fairly straightforward to trace through if you're
> inclined. It's claiming -1 in an mpf_t is equal to +1 in the si
> parameter.
It appears to be an optimization bug. Rebuilding mpf/cmp_si.c with -O0 does the
trick. Stepping through with gdb shows the problem on return from __gmpf_cmp_si
where
return usize >= 0 ? 1 : -1
gives the wrong answer (usize has the correct value).
Thanks for your help.
Schoeller.
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail
More information about the gmp-bugs
mailing list