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.

Reply via email to