2013-01-04 Richard Biener <rguenther@suse.de>
PR tree-optimization/55862
* tree-ssa-pre.c (phi_translate_1): Valueize SSA names after
translating them through PHI nodes.
* gcc.dg/torture/pr55862.c: New testcase.
From-SVN: r194906
+2013-01-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55862
+ * tree-ssa-pre.c (phi_translate_1): Valueize SSA names after
+ translating them through PHI nodes.
+
2013-01-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55755
+2013-01-04 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/55862
+ * gcc.dg/torture/pr55862.c: New testcase.
+
2013-01-04 Martin Jambor <mjambor@suse.cz>
PR tree-optimization/55755
--- /dev/null
+/* { dg-do compile } */\r
+\r
+int g, a, *b;\r
+\r
+void f(void)\r
+{\r
+ int *p;\r
+\r
+ if(g)\r
+ {\r
+ int **k = &p;\r
+\r
+ for(; g; p++)\r
+ for(a = 0; a < 1; a++)\r
+ {\r
+ int *c = p;\r
+label2:\r
+ if(a < 1)\r
+ *c = 0;\r
+ }\r
+\r
+ goto label1;\r
+\r
+ while(g++)\r
+ for(*b = 0; *b; b++)\r
+ label1:\r
+ ;\r
+ }\r
+\r
+ goto label2;\r
+}\r
edge e = find_edge (pred, gimple_bb (def_stmt));
tree def = PHI_ARG_DEF (def_stmt, e->dest_idx);
+ /* Valueize it. */
+ if (TREE_CODE (def) == SSA_NAME)
+ def = VN_INFO (def)->valnum;
+
/* Handle constant. */
if (is_gimple_min_invariant (def))
return get_or_alloc_expr_for_constant (def);