From 7686fb74efd6744c19e457f7e72bdc714ba5ec3e Mon Sep 17 00:00:00 2001 From: Richard Guenther Date: Tue, 16 Mar 2010 12:31:38 +0000 Subject: [PATCH] re PR tree-optimization/43379 (ICE: error: SSA_NAME_OCCURS_IN_ABNORMAL_PHI should be set with -O2 -ftracer) 2010-03-16 Richard Guenther PR middle-end/43379 * tree-cfg.c (gimple_merge_blocks): When propagating virtual PHI operands make sure to merge SSA_NAME_OCCURS_IN_ABNORMAL_PHI properly. * gcc.dg/pr43379.c: New testcase. From-SVN: r157478 --- gcc/ChangeLog | 7 +++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/pr43379.c | 11 +++++++++++ gcc/tree-cfg.c | 3 +++ 4 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/pr43379.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fda7e80c4b1..cd624b5a423 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2010-03-16 Richard Guenther + + PR middle-end/43379 + * tree-cfg.c (gimple_merge_blocks): When propagating virtual + PHI operands make sure to merge SSA_NAME_OCCURS_IN_ABNORMAL_PHI + properly. + 2010-03-16 Aldy Hernandez Alexandre Oliva diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dfe0246adb9..37d07651ee6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2010-03-16 Richard Guenther + + PR middle-end/43379 + * gcc.dg/pr43379.c: New testcase. + 2010-03-16 Jakub Jelinek PR debug/43051 diff --git a/gcc/testsuite/gcc.dg/pr43379.c b/gcc/testsuite/gcc.dg/pr43379.c new file mode 100644 index 00000000000..de9bf66ae19 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr43379.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -ftracer" } */ + +void *foo(int i, int *p) +{ +lab: + if (p) *p = i; + goto *p; + return &&lab; +} + diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index 6f4e4167a6b..01fefc306ef 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -1617,6 +1617,9 @@ gimple_merge_blocks (basic_block a, basic_block b) FOR_EACH_IMM_USE_STMT (stmt, iter, def) FOR_EACH_IMM_USE_ON_STMT (use_p, iter) SET_USE (use_p, use); + + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (def)) + SSA_NAME_OCCURS_IN_ABNORMAL_PHI (use) = 1; } else replace_uses_by (def, use);