aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2010-07-20 12:41:20 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2010-07-20 12:41:20 +0000
commit720151cabda2a56418b32c1b048de33670641e45 (patch)
tree41cab53e4e3521fcb9bc4fa0a65a96ef0019bf99 /gcc
parentcd2be65a3b59dac7280dbf164f4c182682161c69 (diff)
downloadgcc-720151cabda2a56418b32c1b048de33670641e45.zip
gcc-720151cabda2a56418b32c1b048de33670641e45.tar.gz
gcc-720151cabda2a56418b32c1b048de33670641e45.tar.bz2
re PR tree-optimization/44977 (ice in propagate_rhs_into_lhs, at tree-ssa-dom.c:2728)
2010-07-20 Richard Guenther <rguenther@suse.de> PR tree-optimization/44977 * tree-ssa-dom.c (propagate_rhs_into_lhs): Do not create invalid SSA form. * gcc.dg/torture/pr44977.c: New testcase. From-SVN: r162334
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/torture/pr44977.c41
-rw-r--r--gcc/tree-ssa-dom.c14
4 files changed, 66 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 72cd6ae..2065af6 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2010-07-20 Richard Guenther <rguenther@suse.de>
+ PR tree-optimization/44977
+ * tree-ssa-dom.c (propagate_rhs_into_lhs): Do not create invalid
+ SSA form.
+
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
* lto-symtab.c (lto_symtab_merge): Use gimple_types_compatible_p.
(lto_symtab_merge_decls_2): Likewise.
* gimple.h (gimple_types_compatible_p): Declare.
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f1ea52f..ae38e84 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2010-07-20 Richard Guenther <rguenther@suse.de>
+
+ PR tree-optimization/44977
+ * gcc.dg/torture/pr44977.c: New testcase.
+
2010-07-20 Bingfeng Mei <bmei@broadcom.com>
* gcc.dg/lto/20090313_0.c: Use dg-require-effective-target
diff --git a/gcc/testsuite/gcc.dg/torture/pr44977.c b/gcc/testsuite/gcc.dg/torture/pr44977.c
new file mode 100644
index 0000000..66fd7d1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/torture/pr44977.c
@@ -0,0 +1,41 @@
+/* { dg-do compile } */
+/* { dg-options "-w" } */
+
+static unsigned short
+foo (unsigned short ui1, unsigned short ui2)
+{
+ return ui1 - ui2;
+}
+
+static unsigned short
+bar (unsigned ui1, unsigned short ui2)
+{
+ return ui1 + ui2;
+}
+
+struct S1
+{
+ const short f3;
+};
+int g_31;
+short g_67;
+struct S1 g_68[2][5][9][1][1] = {
+};
+
+int func_90 (int);
+
+int int329 (int * const *const int32p_81, short ** p_82)
+{
+ short l_169[8];
+ for (g_31 = 0; g_31 <= 0; g_31 = foo (g_31, 1))
+ {
+ short l_85;
+lbl_89:g_67 ^= l_85;
+ for (l_85 = 0; l_85 >= 0; l_85 = bar)
+ if (g_31)
+ goto lbl_89;
+ func_90 (1), g_68[0][2][2][0][0].f3, 0;
+ }
+ return l_169[6];
+}
+
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 6833820..4715592 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -2559,6 +2559,20 @@ propagate_rhs_into_lhs (gimple stmt, tree lhs, tree rhs, bitmap interesting_name
continue;
}
+ /* It's not ok to propagate into the definition stmt of RHS.
+ <bb 9>:
+ # prephitmp.12_36 = PHI <g_67.1_6(9)>
+ g_67.1_6 = prephitmp.12_36;
+ goto <bb 9>;
+ While this is strictly all dead code we do not want to
+ deal with this here. */
+ if (TREE_CODE (rhs) == SSA_NAME
+ && SSA_NAME_DEF_STMT (rhs) == use_stmt)
+ {
+ all = false;
+ continue;
+ }
+
/* Dump details. */
if (dump_file && (dump_flags & TDF_DETAILS))
{