[PATCH] Fix PR66123
Richard Biener
rguenther@suse.de
Wed May 13 11:27:00 GMT 2015
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.
Richard.
2015-05-13 Richard Biener <rguenther@suse.de>
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.
Index: gcc/tree-ssa-dom.c
===================================================================
*** gcc/tree-ssa-dom.c (revision 223044)
--- gcc/tree-ssa-dom.c (working copy)
*************** propagate_rhs_into_lhs (gimple stmt, tre
*** 2918,2923 ****
--- 2918,2926 ----
{
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;
Index: gcc/testsuite/gcc.dg/torture/pr66123.c
===================================================================
*** gcc/testsuite/gcc.dg/torture/pr66123.c (revision 0)
--- gcc/testsuite/gcc.dg/torture/pr66123.c (working copy)
***************
*** 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;
+ }
More information about the Gcc-patches
mailing list