[Bug fortran/58793] New: Wrong storage_size of class(*) dummy argument with complex actual

vladimir.fuka at gmail dot com gcc-bugzilla@gcc.gnu.org
Fri Oct 18 18:18:00 GMT 2013


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

            Bug ID: 58793
           Summary: Wrong storage_size of class(*) dummy argument with
                    complex actual
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vladimir.fuka at gmail dot com

Complex variable has storage size of only real a variable when passed as
class(*).

module m
contains
 subroutine s(o)
    class(*) :: o

    write (*,*) storage_size(o)
    select type (o)
      type is (complex)
        print *,storage_size(o)
      type is (complex(8))
        print *,storage_size(o)
      type is (complex(16))
        print *,storage_size(o)
    end select
  end 
end

program p
 use m
 call s((1._4,2._4))
 call s((1._8,2._8))
 call s((1._16,2._16))
end

gcc version 4.8.2 20131003


Expected output:
          64
          64
         128
         128
         256
         256


Actual output:
          32
          64
          64
         128
         128
         256



More information about the Gcc-bugs mailing list