[Bug fortran/40019] LEADZ and TRAILZ give wrong results

fxcoudert at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Wed May 27 10:28:00 GMT 2009



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2009-05-27 10:27 -------
(In reply to comment #1)
> I don't think your patch fixes the following,
> 
>   print *, leadz(-1_1), leadz(-1_2), leadz(-1_4), leadz(-1_8), leadz(-1_16)
> 
> which yields
> 
>            7          15          31          63         127

I think it does:

$ cat h.f90 
  print *, leadz(-1_1), leadz(-1_2), leadz(-1_4), leadz(-1_8), leadz(-1_16)
  end
$ gfortran h.f90 && ./a.out 
           0           0           0           0           0


-- 


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



More information about the Gcc-bugs mailing list