From: Richard Biener Date: Mon, 8 Jan 2018 13:22:56 +0000 (+0000) Subject: re PR tree-optimization/83685 (ICE: SSA corruption) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e207c07997748ec104a1caf295e66abb75f0eb3f;p=gcc.git re PR tree-optimization/83685 (ICE: SSA corruption) 2018-01-08 Richard Biener PR tree-optimization/83685 * tree-ssa-pre.c (create_expression_by_pieces): Do not insert references to abnormals. * gcc.dg/torture/pr83685.c: New testcase. From-SVN: r256339 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 0c9d6947d68..cbd431aed83 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2018-01-08 Richard Biener + + PR tree-optimization/83685 + * tree-ssa-pre.c (create_expression_by_pieces): Do not insert + references to abnormals. + 2018-01-08 Richard Biener PR lto/83719 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ccc94d1b2a6..25f82aea1f6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-01-08 Richard Biener + + PR tree-optimization/83685 + * gcc.dg/torture/pr83685.c: New testcase. + 2018-01-08 Richard Biener PR lto/83719 diff --git a/gcc/testsuite/gcc.dg/torture/pr83685.c b/gcc/testsuite/gcc.dg/torture/pr83685.c new file mode 100644 index 00000000000..062f75d23e9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr83685.c @@ -0,0 +1,20 @@ +/* { dg-do compile } */ + +int _setjmp (void *); +void foo (int); + +void +bar (int e, int b, char c, void *d) +{ + while (b) + { + if (_setjmp (d)) + foo (e); + if (c) + { + e--; + foo (0); + } + e++; + } +} diff --git a/gcc/tree-ssa-pre.c b/gcc/tree-ssa-pre.c index 63c2a6a209b..55295e171e9 100644 --- a/gcc/tree-ssa-pre.c +++ b/gcc/tree-ssa-pre.c @@ -2697,6 +2697,8 @@ create_expression_by_pieces (basic_block block, pre_expr expr, that value numbering saw through. */ case NAME: folded = PRE_EXPR_NAME (expr); + if (SSA_NAME_OCCURS_IN_ABNORMAL_PHI (folded)) + return NULL_TREE; if (useless_type_conversion_p (exprtype, TREE_TYPE (folded))) return folded; break;