From 98dc565ef07f8bf9d720ea419bc1ce14bafc4a3a Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 15 Apr 2019 11:59:02 +0000 Subject: [PATCH] re PR tree-optimization/90071 (internal compiler error: SSA corruption) 2019-04-15 Richard Biener PR tree-optimization/90071 * tree-ssa-reassoc.c (init_range_entry): Do not pick up abnormal operands from def stmts. * gcc.dg/torture/pr90071.c: New testcase. From-SVN: r270369 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr90071.c | 24 ++++++++++++++++++++++++ gcc/tree-ssa-reassoc.c | 3 ++- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/gcc.dg/torture/pr90071.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8f8ec28afce..0d61af49e43 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2019-04-15 Richard Biener + + PR tree-optimization/90071 + * tree-ssa-reassoc.c (init_range_entry): Do not pick up + abnormal operands from def stmts. + 2019-04-15 Richard Biener PR ipa/88936 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index be91be7c11b..38fcc79aa7d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2019-04-15 Richard Biener + + PR tree-optimization/90071 + * gcc.dg/torture/pr90071.c: New testcase. + 2019-04-15 Segher Boessenkool PR rtl-optimization/89794 diff --git a/gcc/testsuite/gcc.dg/torture/pr90071.c b/gcc/testsuite/gcc.dg/torture/pr90071.c new file mode 100644 index 00000000000..bfa7239139a --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr90071.c @@ -0,0 +1,24 @@ +/* { dg-do compile } */ + +int a; +static int b; + +void +foo () +{ + int d; + int e = (int) (__INTPTR_TYPE__) &&f; + void *g = &&h; +h: ++e; + if (a) + i: goto *g; + for (;;) + { + e = 0; + if (b) + goto i; + } +f: + goto *({ d || e < 0 || e >= 2; }); + &e; +} diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index e1c4dfe537e..32bff979416 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -2143,7 +2143,8 @@ init_range_entry (struct range_entry *r, tree exp, gimple *stmt) exp_type = boolean_type_node; } - if (TREE_CODE (arg0) != SSA_NAME) + if (TREE_CODE (arg0) != SSA_NAME + || SSA_NAME_OCCURS_IN_ABNORMAL_PHI (arg0)) break; loc = gimple_location (stmt); switch (code) -- 2.30.2