This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/50070] Segmentation fault at size_binop_loc in fold-const.c
- From: "janus at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 14 Aug 2011 13:10:57 +0000
- Subject: [Bug fortran/50070] Segmentation fault at size_binop_loc in fold-const.c
- Auto-submitted: auto-generated
- References: <bug-50070-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50070
janus at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |ASSIGNED
Last reconfirmed| |2011-08-14
AssignedTo|unassigned at gcc dot |janus at gcc dot gnu.org
|gnu.org |
Ever Confirmed|0 |1
--- Comment #6 from janus at gcc dot gnu.org 2011-08-14 13:10:57 UTC ---
Here is a preliminary patch which rejects the original test case:
Index: gcc/fortran/resolve.c
===================================================================
--- gcc/fortran/resolve.c (revision 177744)
+++ gcc/fortran/resolve.c (working copy)
@@ -858,6 +858,12 @@ resolve_common_vars (gfc_symbol *sym, bool named_c
&csym->declared_at);
}
+ /* F08:C5100. */
+ if (csym->ts.type == BT_CHARACTER
+ && !gfc_is_constant_expr (csym->ts.u.cl->length))
+ gfc_error_now ("Automatic object %s at %L may not be in a COMMON block",
+ csym->name, &csym->declared_at);
+
if (csym->ts.type != BT_DERIVED)
continue;