This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/19577] New: initial padding for COMMON blocks - order of variables


Hello, short fortran software:
=======================================
       Program TEST_COMMON_BLOCKS

       implicit real*8 (a-h,o-z)
       common /common_block/ a,i
 
       a=1.25
       i=-4
       write(*,*) "main prog:", i,a

       call subr

       stop  0
       end

       subroutine subr
       implicit real*8 (a-h,o-z)
C      common /common_block/ a,i  ! does compile perfectly
C      common /common_block2/ i,a   ! does compile with warning...
       common /common_block/ i,a   ! does NOT COMPILE - error with padding

       a=-2.585
       i=8
       write(*,*) "subroutine :", i,a

       return
       end
======================================================================

It gives:
g77 -fno-globals -Wno-globals -Wall tc.f 
tc.f: In subroutine `subr':
tc.f:4: 
          common /common_block/ a,i
                  1
tc.f:19: (continued):
          common /common_block/ i,a   ! does NOT COMPILE - error with paddi
                  2
Initial padding for common block `common_block' is 4 bytes at (2) but 0 bytes 
at (1) -- consider reordering members, largest-type-size first

The g77 is sensitive on the order of variable types. Commercial ifc does 
compile it well.
                                     Miro

-- 
           Summary: initial padding for COMMON blocks - order of variables
           Product: gcc
           Version: 3.3.3
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ilias at utcpd dot sk
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: PC linux
GCC target triplet: gcc/g77 version 3.3.3


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]