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,fortran] Fix PR19310 unnecessary error for overflowing results

> > > > >This makes me nervous. I'd expect overflowed values to be set to
> > > > > +-Inf, like  for we set underflowed values to zero.
> > >
> > > Jerry, I just realized that the above also disables range checking
> > > for integer types.  This may be the cause of Paul's nervousness.
> > > I think we want to continue range checking integers where Inf and
> > > NaN don't apply.
> >
> > Good point, I hadn't spotted that.
> > However my concern was that we now have out-of-range real values, which
> > could cause bad things to happen later on.
> AFAIK, mpfr propagates inf and nan according to IEEE-754, so
> the front-end should be okay.  I have insufficient knowledge
> of what the middle-end and backend do with these values.
> I did submit a PR 24581 about problems with C99's complex type
> and these special values.  Joseph Meyer seems to disagree
> with my analysis of the problem.

Are we sure we have inf or nan at this point? ie. do the MPFR arithmetic 
routines always generate inf when a calculation overflows the range of the 
corresponding fortran type?

If they do then I'm happy. If not I think we should be doing that saturation 
in gfc_check_range. Ending up with "too big" finite values is what I want to 


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