This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/68283] [5/6 Regression] ice: gfc_variable_attr(): Bad array reference
- From: "kargl at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 11 Nov 2015 17:53:42 +0000
- Subject: [Bug fortran/68283] [5/6 Regression] ice: gfc_variable_attr(): Bad array reference
- Auto-submitted: auto-generated
- References: <bug-68283-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68283
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |kargl at gcc dot gnu.org
--- Comment #5 from kargl at gcc dot gnu.org ---
(In reply to Manuel LÃpez-IbÃÃez from comment #4)
>
> Does the ICE happens while printing an error? If not, something must be
> checking for buffered errors and changing behavior depending on that. The
> new code might be clearing the buffered errors flag (or not buffering them
> at all) too early.
No. It happens after error messages have been issued.
The ICE goes away with
laptop-kargl:kargl[219] svn diff primary.c
Index: primary.c
===================================================================
--- primary.c (revision 229970)
+++ primary.c (working copy)
@@ -2268,8 +2268,6 @@ gfc_variable_attr (gfc_expr *expr, gfc_t
&& errors > 0)
break;
}
- if (n == ref->u.ar.as->rank)
- gfc_internal_error ("gfc_variable_attr(): Bad array reference");
}
break;
There are a number of questionable gfc_internal_error()'s within gfortran.
I suspect some come from the idea "Correctly written Fortran code cannot
possibly reach this point, so there must be some internal error to get
here." The original code should have simply returned because clearly
"Poorly written invalid code can reach this point, and an internal
error is not appropriate. So, let gfortran exit gracefully".