This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/53086] [4.8 Regression] 416.gamess in SPEC CPU 2006 miscompiled
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 24 Apr 2012 09:29:10 +0000
- Subject: [Bug fortran/53086] [4.8 Regression] 416.gamess in SPEC CPU 2006 miscompiled
- Auto-submitted: auto-generated
- References: <bug-53086-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53086
--- Comment #10 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-04-24 09:29:10 UTC ---
A "fix" would be for example
Index: gcc/expr.c
===================================================================
--- gcc/expr.c (revision 186757)
+++ gcc/expr.c (working copy)
@@ -6809,7 +6809,8 @@ array_at_struct_end_p (tree ref)
/* If the reference is based on a declared entity, the size of the array
is constrained by its given domain. */
- if (DECL_P (ref))
+ if (DECL_P (ref)
+ && !DECL_COMMON (ref))
return false;
return true;
of course other parts of the compiler will still be affected by this.
If the Frontend wants to reliably make this work then it has to use
an open-ended TYPE_DOMAIN for the array (and then lay out the underlying
decl manually). Not sure if that's easy though (the incomplete type might
trigger ICEs in other places).