[Bug fortran/67758] [GCC 6 regression] ICE on invalid use of COMMON
sgk at troutmask dot apl.washington.edu
gcc-bugzilla@gcc.gnu.org
Tue Sep 29 20:24:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67758
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu> ---
On Tue, Sep 29, 2015 at 07:56:16PM +0000, kargl at gcc dot gnu.org wrote:
>
> troutmask:sgk[204] gfc6 -c r5.f
> f951: internal compiler error: Segmentation fault
> no stack trace because unwind library not available
> Please submit a full bug report,
> with preprocessed source if appropriate.
> See <http://gcc.gnu.org/bugs.html> for instructions.
This fixes the regression.
Index: symbol.c
===================================================================
--- symbol.c (revision 228264)
+++ symbol.c (working copy)
@@ -3211,6 +3211,8 @@ gfc_restore_last_undo_checkpoint (void)
while (csym != p)
{
+ if (!csym)
+ goto syntax;
cparent = csym;
csym = csym->common_next;
}
@@ -3242,6 +3244,11 @@ gfc_restore_last_undo_checkpoint (void)
if (!single_undo_checkpoint_p ())
pop_undo_change_set (latest_undo_chgset);
+
+ return;
+
+syntax:
+ gfc_error ("syntax or semantics issue at %C");
}
But, the real issue is that the second COMMON is not
allowed to appear in the execution block of a program.
gfortran should probably error out earlier.
More information about the Gcc-bugs
mailing list