Bootstrapped and tested on x86_64-unknown-linux-gnu, applied. Richard.
2018-01-08 Richard Biener <rguent...@suse.de> 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. Index: gcc/tree-ssa-pre.c =================================================================== --- gcc/tree-ssa-pre.c (revision 256329) +++ gcc/tree-ssa-pre.c (working copy) @@ -2697,6 +2697,8 @@ create_expression_by_pieces (basic_block 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; Index: gcc/testsuite/gcc.dg/torture/pr83685.c =================================================================== --- gcc/testsuite/gcc.dg/torture/pr83685.c (nonexistent) +++ gcc/testsuite/gcc.dg/torture/pr83685.c (working copy) @@ -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++; + } +}