This is the mail archive of the gcc-patches@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: [patch,fortran] Fix PR19310 unnecessary error for overflowing results


> > >>*************** 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


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