Cf. also PR 45044. Long test case: gfortran.dg/common_resize_1.f Without -fwhole-file or without "call two", gfortran warns:
common /xx/ a, b, c, y 1 Warning: Named COMMON block 'xx' at (1) shall be of the same size But as soon as "call two()" is added, no warning is printed. If one uses "call one()" the warning is printed. subroutine one() integer :: a, b common /xx/ a, b end subroutine two() integer :: a, b, c real(8) :: y common /xx/ a, b, c, y end call two() end -- Summary: Named COMMON with different size: No warning with - fwhole-file Product: gcc Version: 4.6.0 Status: UNCONFIRMED Keywords: accepts-invalid, diagnostic Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: burnus at gcc dot gnu dot org OtherBugsDependingO 45044 nThis: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45045