public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/50273] New: [4.5/4.6/4.7 Regression] -Walign-commons no longer effective
@ 2011-09-02 10:03 burnus at gcc dot gnu.org
  2011-09-02 10:11 ` [Bug fortran/50273] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-09-02 10:03 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 50273
           Summary: [4.5/4.6/4.7 Regression] -Walign-commons no longer
                    effective
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: burnus@gcc.gnu.org


Motivated by the thread:
http://groups.google.com/group/comp.lang.fortran/browse_thread/thread/1f5e2018f744e5c6


With gfortran 4.4, one got the warning:

  common /global_var/ a, b, c
                     1
Warning: COMMON 'global_var' at (1) requires 3 bytes of padding at start;
reorder elements or use -fno-align-commons


However, with gfortran 4.5/4.6/4.7, it compiles without warning - not even with
-Walign-commons


Note: In 4.5 there was a change in how padding works. Before, the padding was
added before the "too short" variable, now it is added after the variable. The
advantage is a better compatibility with C struct and for common blocks of
different length in different scopes (which is valid for blank commons).
Cf. http://gcc.gnu.org/gcc-4.5/changes.html#Fortran

I assume that this change broke the test.

Example (cf. link for a longer, C+Fortran example):

subroutine test()
   character :: a
   integer   :: b
   character :: c
   common /global_var/ a, b, c
   print *, a, b, c
end subroutine test


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2011-10-11 12:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-02 10:03 [Bug fortran/50273] New: [4.5/4.6/4.7 Regression] -Walign-commons no longer effective burnus at gcc dot gnu.org
2011-09-02 10:11 ` [Bug fortran/50273] " rguenth at gcc dot gnu.org
2011-09-02 10:12 ` rguenth at gcc dot gnu.org
2011-09-02 12:57 ` burnus at gcc dot gnu.org
2011-09-07 17:12 ` jakub at gcc dot gnu.org
2011-10-10  6:54 ` burnus at gcc dot gnu.org
2011-10-11  9:59 ` burnus at gcc dot gnu.org
2011-10-11 12:34 ` burnus at gcc dot gnu.org
2011-10-11 12:34 ` burnus at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).