From 504c0e4f17ae32c0d14caa6b02098346ac98992d Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 17 Aug 2004 16:33:46 -0700 Subject: [PATCH] re PR tree-optimization/17051 (ICE: internal compiler error: verify_ssa failed.for SSA_NAME: l_addr_650) PR 17051 * tree-sra.c (scalarize_use): Mark all v_defs for !is_output too. From-SVN: r86158 --- gcc/ChangeLog | 5 +++++ .../gcc.c-torture/compile/20040817-1.c | 19 +++++++++++++++++++ gcc/tree-sra.c | 6 ++---- 3 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/gcc.c-torture/compile/20040817-1.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 81822a29c97..3e3252d7633 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2004-08-17 Richard Henderson + + PR 17051 + * tree-sra.c (scalarize_use): Mark all v_defs for !is_output too. + 2004-08-17 DJ Delorie * doc/extend.texi: Document new xstormy16 attribute. diff --git a/gcc/testsuite/gcc.c-torture/compile/20040817-1.c b/gcc/testsuite/gcc.c-torture/compile/20040817-1.c new file mode 100644 index 00000000000..158596c8f2d --- /dev/null +++ b/gcc/testsuite/gcc.c-torture/compile/20040817-1.c @@ -0,0 +1,19 @@ +/* PR 17051: SRA failed to rename the VOPS properly. */ + +struct A +{ + char c, d; +}; + +void foo(struct A *p) +{ + struct A a = *p; + + if (p->c) + bar1(a); + else + { + if (p) bar2(a,a.c); + bar3(a.c); + } +} diff --git a/gcc/tree-sra.c b/gcc/tree-sra.c index b3fa20c6c77..e6b254c6145 100644 --- a/gcc/tree-sra.c +++ b/gcc/tree-sra.c @@ -1780,11 +1780,9 @@ scalarize_use (struct sra_elt *elt, tree *expr_p, block_stmt_iterator *bsi, generate_copy_inout (elt, is_output, generate_element_ref (elt), &list); if (list == NULL) return; + mark_all_v_defs (expr_first (list)); if (is_output) - { - mark_all_v_defs (expr_first (list)); - sra_insert_after (bsi, list); - } + sra_insert_after (bsi, list); else sra_insert_before (bsi, list); } -- 2.30.2