From b56b040c8438eeabeb633cf0048571c3389af990 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Wed, 13 May 2015 10:59:49 +0000 Subject: [PATCH] re PR tree-optimization/66123 (Array of labels as values + ternary operator + pointer arithmetic = internal compiler error) 2015-05-13 Richard Biener PR tree-optimization/66123 * tree-ssa-dom.c (propagate_rhs_into_lhs): Check if we found a taken edge. * gcc.dg/torture/pr66123.c: New testcase. From-SVN: r223130 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/torture/pr66123.c | 11 +++++++++++ gcc/tree-ssa-dom.c | 3 +++ 4 files changed, 25 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr66123.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index aa9c72e1dd6..d9a4fe43173 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-05-13 Richard Biener + + PR tree-optimization/66123 + * tree-ssa-dom.c (propagate_rhs_into_lhs): Check if we found + a taken edge. + 2015-05-13 Richard Biener PR middle-end/66110 diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index be355503c3a..8dcf8cb49ec 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-05-13 Richard Biener + + PR tree-optimization/66123 + * gcc.dg/torture/pr66123.c: New testcase. + 2015-05-13 Richard Biener PR middle-end/66110 diff --git a/gcc/testsuite/gcc.dg/torture/pr66123.c b/gcc/testsuite/gcc.dg/torture/pr66123.c new file mode 100644 index 00000000000..848f8fedcee --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr66123.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ + +int +test (int foo) +{ + static void *dummy[] = { &&a, &&b }; + goto *((char *) &&b - 2 * (foo < 0)); +a: +b: + return 0; +} diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c index 14f3e9ef928..42324ee6214 100644 --- a/gcc/tree-ssa-dom.c +++ b/gcc/tree-ssa-dom.c @@ -2918,6 +2918,9 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name { basic_block bb = gimple_bb (use_stmt); edge te = find_taken_edge (bb, val); + if (!te) + continue; + edge_iterator ei; edge e; gimple_stmt_iterator gsi; -- 2.30.2