Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2015-05-13  Richard Biener  <rguent...@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;
+ }

Reply via email to