[Bug fortran/37930] gfortran error and ICE at automatic type conversion with transfer intrinsic
sgk at troutmask dot apl dot washington dot edu
gcc-bugzilla@gcc.gnu.org
Tue Oct 28 14:04:00 GMT 2008
------- Comment #6 from sgk at troutmask dot apl dot washington dot edu 2008-10-28 14:03 -------
Subject: Re: gfortran error and ICE at automatic type conversion with transfer
intrinsic
On Tue, Oct 28, 2008 at 01:30:28PM -0000, dominiq at lps dot ens dot fr wrote:
>
> ------- Comment #5 from dominiq at lps dot ens dot fr 2008-10-28 13:30 -------
> On *-Darwin9 I get:
>
> i = transfer(-1,1.0)
> 1
> Error: Arithmetic overflow converting REAL(4) to INTEGER(4) at (1). This check
> can be disabled with the option -fno-range-check
What does
program test
print *, transfer(-1,1.0)
end program test
print?
> I have not tested the patch in
> http://gcc.gnu.org/ml/gcc-patches/2008-10/msg01183.html, but I am afraid that
> it will just hide the bug.
The actual bug is in the Fortran code! My patch simply fixes the
ICE in gfortran. By itself, transfer(-1,1.0) is valid and it so
happens to be an NaN. i = NaN is invalid (although I doubt the
standard will actually say i = NaN is invalid in a straight forward
manner).
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37930
More information about the Gcc-bugs
mailing list