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/50273] [4.5/4.6/4.7 Regression] -Walign-commons no longer effective


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

--- Comment #2 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-09-02 12:57:03 UTC ---
(In reply to comment #1)
> > ./f951 -quiet t.f90 -Wpadded
> Note that suggesting -fno-align-commons shouldn't be done - using it
> can severely reduce performance.

But to be 100% Fortran standard conforming, one has to use -fno-align-commons,
if I recall correctly. I think the standard demands that the memory is
contiguously, though at the moment, I fail to come up with a
standard-conforming code which would run into issues with -falign-commons (i.e.
the default) - at least after the 4.5 change.

(Side note: The Intel compiler has a similar option (-(no)align): "By default,
no padding is added to common blocks but padding is added to structures.".)

 * * *

Regarding -Wpadded: I have not thoroughly investigated. What puzzles me is the
string "pending" as I could not find the string anywhere.

 * * *

Regarding the missing front-end warning: The following seems to work (only
lightly tested):

--- a/gcc/fortran/trans-common.c
+++ b/gcc/fortran/trans-common.c
@@ -1069,3 +1069,2 @@ translate_common (gfc_common_head *common, gfc_symbol
*var_list)
   unsigned HOST_WIDE_INT align;
-  unsigned HOST_WIDE_INT max_align;
   bool saw_equiv;
@@ -1076,3 +1075,2 @@ translate_common (gfc_common_head *common, gfc_symbol
*var_list)
   align = 1;
-  max_align = 1;
   saw_equiv = false;
@@ -1119,3 +1117,3 @@ translate_common (gfc_common_head *common, gfc_symbol
*var_list)

-         if (offset & (max_align - 1))
+         if (offset)
            {
@@ -1142,4 +1140,2 @@ translate_common (gfc_common_head *common, gfc_symbol
*var_list)
          current_offset += offset;
-         if (max_align < align)
-           max_align = align;


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