[Bug fortran/47023] [4.6/4.7 regression] C_Sizeof: Rejects valid code
kargl at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Sep 20 15:40:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023
--- Comment #4 from kargl at gcc dot gnu.org 2011-09-20 14:57:00 UTC ---
(In reply to comment #3)
> (In reply to comment #2)
> > I'm seeing this bug even for an explicitly interoperable type (hence I'm not
> > sure if this is really the same bug - I'm happy to file a new one if someone
> > tells me to):
> >
> > print *, c_sizeof(0.0_c_double)
> > 1
> > Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be be an interoperable
> > data entity
> >
> > GNU Fortran (Ubuntu 4.6.0-1ubuntu1~ppa2) 4.6.1 20110326 (prerelease)
>
> This is now a regression.
>
> troutmask:sgk[208] gfc45 -o z foo.f90
> troutmask:sgk[209] ./z
> 8
> troutmask:sgk[210] gfc46 -o z foo.f90
> foo.f90:3.25:
>
> print '(I0)', c_sizeof(0.0_c_double)
> 1
> Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be be an interoperable
> data entity
>
> troutmask:sgk[211] cat foo.f90
> program foo
> use iso_c_binding
> print '(I0)', c_sizeof(0.0_c_double)
> end program foo
This seems to be a bug only when the actual argument is parameter.
program foo
use iso_c_binding
real(c_double) x
print *, c_sizeof(x)
end program foo
works as expected.
More information about the Gcc-bugs
mailing list