This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] fix c/39902 for decimal float constant folding

On Fri, 2009-06-26 at 19:50 +0200, Richard Guenther wrote:
> On Fri, Jun 26, 2009 at 7:33 PM, Janis Johnson<> wrote:
> > In decimal floating-point arithmetic, trailing zeroes are significant;
> > the values 1.DD, 1.0DD, and 1.00DD are all different, and arithmetic on
> > each of those values gives a different result.  This means that GCC
> > should not perform optimizations like replacing (x * 1) with x when
> > the constant is a decimal float value.
> Is this really true for real_zerop as well?  I do find it odd that zero doesn't
> have a single exact representation in decimal floating-point.

Strange but true, see PR c/35712.

> > This patch modifies several functions that check for specific values of
> > real constants so they don't handle decimal float values.
> >
> > Tested with bootstrap and regtest of all languages but Ada on
> > powerpc64-linux for -m32/-m64.  OK for trunk and, after testing there,
> > on 4.4 and 4.3 branches?  This is not a regression but it does fix
> > wrong code.
> If the real_zerop change is really warranted the patch is ok for trunk
> and the branches.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]