This is the mail archive of the gcc@gcc.gnu.org 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: Inline round for IA64


On Thu, Apr 07, 2005 at 07:14:05PM +0100, Paul Brook wrote:
> On Thursday 07 April 2005 18:54, Steve Kargl wrote:
> > On Thu, Apr 07, 2005 at 01:41:21PM -0400, Geert Bosch wrote:
> > > On Apr 7, 2005, at 13:27, Steve Kargl wrote:
> > > >Try -fdump-parse-tree.  You've given more digits in y than
> > > >its precision.  This is permitted by the standard.  It appears
> > > >the gfortran frontend is taking y = 0.499999 and the closest
> > > >representable nubmer is y = 0.5.
> > >
> > > So, why does the test y < 0.5 yield true then?
> >
> > I missed that part of the output.  The exceeding
> > long string of digits caught my attention.  Can
> > you submit a PR?  The problem, I believe, is in
> > gfc_simplify_nint
> 
> Unlikely, although that may also be buggy. fc_simplify_* only applies to 
> compile time costants. You probably want build_round_expr in 
> trans-intrinsic.c
> 

It's buggy.  If I have time this weekend, I'll check build_round_expr.
Meanwhile, the attached patch and testcase fix the problem with gfortran's
constant folding.  Bubblestrapped and Regression tested on mainline
for amd64-*-freebsd.

Ok to commit to mainline?  Ok to commit to 4.0 after strapping 
and testing?

2005-04-08  Steven G. Kargl  <kargls@comcast.net>

	* simplify.c (simplify_nint):  Fix rounding for corner cases

2005-04-08  Steven G. Kargl  <kargls@comcast.net>

	* gfortran.dg/nint_1.f90: New test.

-- 
Steve

Attachment: nint.diff
Description: Text document

Attachment: nint_1.f90
Description: Text document


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