This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/11452] [tree-ssa] ICE with variable-sized arrays
- From: "law at redhat dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2003 16:51:56 -0000
- Subject: [Bug c/11452] [tree-ssa] ICE with variable-sized arrays
- References: <20030707112909.11452.reichelt@gcc.gnu.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11452
------- Additional Comments From law at redhat dot com 2003-07-16 16:51 -------
Subject: Re: [tree-ssa] ICE with variable-sized arrays
In message <200307071333.h67DXFNZ022408@relay.rwth-aachen.de>, Volker Reichelt
writes:
>Hi Jeff,
>
>given the location of the error (store_parm_decls) and the fact that the
>regression was introduced between 2003-07-03 and 2003-07-04, it looks
>like your patch
>
>2003-07-03 Jeff Law <law@redhat.com>
>
> * tree-ssa.c (lookup_avail_expr): Accept new argument containing the
> const_and_copies table. All callers changed. If we find the
> given expression in the availe expression hash table, then lookup
> the LHS of the hash table's entry in the const_and_copies_table.
> Do record type casts into the available expression table.
>
> * tree-nomudflap.c (mf_marked_p): Mark arguments as being unused.
> (mf_mark): Likewise.
>
> * c-decl.c (store_parm_decls): Strip away NOP_EXPRs when looking
> for hidden use variables.
>
>is responsible for the failure. Could you please have a look?
I fixed this bug with the attached patch. I also checked in the testcase
to the regression testsuite on the tree-ssa branch.
* c-decl.c (store_parm_decls): Also strip NON_LVALUE_EXPRs and
CONVERT_EXPRs when setting DECL_NONLOCAL.
Index: c-decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/c-decl.c,v
retrieving revision 1.334.2.51
diff -c -3 -p -r1.334.2.51 c-decl.c
*** c-decl.c 3 Jul 2003 09:07:57 -0000 1.334.2.51
--- c-decl.c 16 Jul 2003 16:49:03 -0000
*************** store_parm_decls ()
*** 6144,6152 ****
/* We will have a nonlocal use of this variable. */
tree var = TREE_OPERAND (TREE_VALUE (t), 0);
! /* Strip away any NOP_EXPRs. STRIP_NOPS is not sufficient
! here since the nodes may have different modes. */
! while (TREE_CODE (var) == NOP_EXPR)
var = TREE_OPERAND (var, 0);
DECL_NONLOCAL (var) = 1;
--- 6144,6155 ----
/* We will have a nonlocal use of this variable. */
tree var = TREE_OPERAND (TREE_VALUE (t), 0);
! /* Strip away any NOP_EXPRs, NON_LVALUE_EXPRs and CONVERT_EXPRs.
! STRIP_NOPS is not sufficient here since the nodes may have
! different modes. */
! while (TREE_CODE (var) == NOP_EXPR
! || TREE_CODE (var) == NON_LVALUE_EXPR
! || TREE_CODE (var) == CONVERT_EXPR)
var = TREE_OPERAND (var, 0);
DECL_NONLOCAL (var) = 1;