From: Richard Biener Date: Wed, 14 Jun 2017 07:22:32 +0000 (+0000) Subject: re PR tree-optimization/81083 (ICE: Unable to coalesce ssa_names 4 and 13 which are... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=24d020bd46fc94b262af4f729aff24fb4ee8aca3;p=gcc.git re PR tree-optimization/81083 (ICE: Unable to coalesce ssa_names 4 and 13 which are marked as MUST COALESCE) 2017-06-14 Richard Biener PR tree-optimization/81083 * tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals as values. * gcc.dg/torture/pr81083.c: New testcase. From-SVN: r249182 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ab872e158cc..8960eabda1d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-06-14 Richard Biener + + PR tree-optimization/81083 + * tree-ssa-sccvn.c (vn_reference_lookup_3): Do not use abnormals + as values. + 2017-06-13 Segher Boessenkool * config/rs6000/rs6000.c: Update all comments that mentioned SPE. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1378dc8946c..0bc4384fa67 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-06-14 Richard Biener + + PR tree-optimization/81083 + * gcc.dg/torture/pr81083.c: New testcase. + 2017-06-14 Jakub Jelinek * gcc.dg/tree-ssa/vrp101.c: Fix scan-tree-dump regex. diff --git a/gcc/testsuite/gcc.dg/torture/pr81083.c b/gcc/testsuite/gcc.dg/torture/pr81083.c new file mode 100644 index 00000000000..39c3f63017a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr81083.c @@ -0,0 +1,13 @@ +/* { dg-do compile } */ + +void a(int arg) +{ + extern struct { int x; } obj; + setjmp(); + obj.x = arg; + arg = arg; + if (obj.x) + func(); + if (obj.x) + func(); +} diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index ff5c800662b..419da47b5b7 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -2035,7 +2035,9 @@ vn_reference_lookup_3 (ao_ref *ref, tree vuse, void *vr_, ops[1] = bitsize_int (ref->size); ops[2] = bitsize_int (offset - offset2); tree val = vn_nary_build_or_lookup (rcode, vr->type, ops); - if (val) + if (val + && (TREE_CODE (val) != SSA_NAME + || ! SSA_NAME_OCCURS_IN_ABNORMAL_PHI (val))) { vn_reference_t res = vn_reference_lookup_or_insert_for_pieces (vuse, vr->set, vr->type, vr->operands, val);