------- Comment #8 from sgk at troutmask dot apl dot washington dot edu  
2008-10-28 15:03 -------
Subject: Re:  gfortran error and ICE at automatic type conversion with transfer
intrinsic

On Tue, Oct 28, 2008 at 02:36:07PM -0000, dominiq at lps dot ens dot fr wrote:
> 
> > What does ... print?
> 
> NaN on both ppc/intel-Darwin9.
> 
> > My patch simply fixes the ICE in gfortran.
> 
> I think the conversion of NaN to int is buggy since the behavior
> is platform/option dependent. Your patch just prevents to reach
> the bug. It always make me nervous when a bug is hidden without
> being understood.

i = NaN is an assignment not a bitwise copy.  This isn't platform
dependent nor option dependent.  You simply can't assign a NaN to
an INTEGER.

In thinking about transfer(-1,1.0), this may also be invalid
because the standard forbids calling an intrinsic procedure
if it will return a result outside the representable range of
the return type.  There is probably some argument on whether
NaN is this range.  


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37930

Reply via email to