[patch,fortran] Fix PR19310 unnecessary error for overflowing results
Paul Brook
paul@codesourcery.com
Sun Jun 11 15:44:00 GMT 2006
> > >>*************** gfc_range_check (gfc_expr * e)
> > >>*** 555,560 ****
> > >>--- 555,563 ----
> > >> {
> > >> arith rc;
> > >>
> > >>+ if (gfc_option.flag_range_check == 0)
> > >>+ return ARITH_OK;
> > >>+
> > >
> > >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.
Paul
More information about the Gcc-patches
mailing list