This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/31188] ICE on vector subscript of a parameter array
- From: "pault at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 15 Mar 2007 20:36:29 -0000
- Subject: [Bug fortran/31188] ICE on vector subscript of a parameter array
- References: <bug-31188-10259@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from pault at gcc dot gnu dot org 2007-03-15 20:36 -------
(In reply to comment #2)
(In reply to comment #1)
> The program works as expected. n.sym->name is ivec. I don't understand why ivec
> is FL_PARAMETER and not FL_VARIABLE.
It is not correct to have the line gcc_assert (begin->expr_type == EXPR_ARRAY).
This section was somebody else's (no names!) contribution to this function:)
This expression is not simplifiable and should return on finding that the
vector index is a variabe. This works correctly:
Index: gcc/fortran/expr.c
===================================================================
*** gcc/fortran/expr.c (revision 122847)
--- gcc/fortran/expr.c (working copy)
*************** find_array_section (gfc_expr *expr, gfc_
*** 1062,1069 ****
if (ref->u.ar.dimen_type[d] == DIMEN_VECTOR) /* Vector subscript. */
{
! gcc_assert (begin);
! gcc_assert (begin->expr_type == EXPR_ARRAY);
gcc_assert (begin->rank == 1);
gcc_assert (begin->shape);
--- 1062,1075 ----
if (ref->u.ar.dimen_type[d] == DIMEN_VECTOR) /* Vector subscript. */
{
! gcc_assert (begin);
!
! if (begin->expr_type == EXPR_ARRAY);
! {
! t = FAILURE;
! goto cleanup;
! }
!
gcc_assert (begin->rank == 1);
gcc_assert (begin->shape);
Paul
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31188