aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/ipa-split.c12
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c10
4 files changed, 30 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 11d53e0..8900009 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/52019
+ * ipa-split.c (find_return_bb, find_retval, visit_bb): Ignore
+ CLOBBER stmts.
+
2012-02-23 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* acinclude.m4: Use HAVE_INITFINI_ARRAY_SUPPORT instead of
diff --git a/gcc/ipa-split.c b/gcc/ipa-split.c
index 124098ce..cb35150 100644
--- a/gcc/ipa-split.c
+++ b/gcc/ipa-split.c
@@ -1,5 +1,5 @@
/* Function splitting pass
- Copyright (C) 2010, 2011
+ Copyright (C) 2010, 2011, 2012
Free Software Foundation, Inc.
Contributed by Jan Hubicka <jh@suse.cz>
@@ -624,7 +624,9 @@ find_return_bb (void)
for (bsi = gsi_last_bb (e->src); !gsi_end_p (bsi); gsi_prev (&bsi))
{
gimple stmt = gsi_stmt (bsi);
- if (gimple_code (stmt) == GIMPLE_LABEL || is_gimple_debug (stmt))
+ if (gimple_code (stmt) == GIMPLE_LABEL
+ || is_gimple_debug (stmt)
+ || gimple_clobber_p (stmt))
;
else if (gimple_code (stmt) == GIMPLE_ASSIGN
&& found_return
@@ -657,7 +659,8 @@ find_retval (basic_block return_bb)
for (bsi = gsi_start_bb (return_bb); !gsi_end_p (bsi); gsi_next (&bsi))
if (gimple_code (gsi_stmt (bsi)) == GIMPLE_RETURN)
return gimple_return_retval (gsi_stmt (bsi));
- else if (gimple_code (gsi_stmt (bsi)) == GIMPLE_ASSIGN)
+ else if (gimple_code (gsi_stmt (bsi)) == GIMPLE_ASSIGN
+ && !gimple_clobber_p (gsi_stmt (bsi)))
return gimple_assign_rhs1 (gsi_stmt (bsi));
return NULL;
}
@@ -733,6 +736,9 @@ visit_bb (basic_block bb, basic_block return_bb,
if (is_gimple_debug (stmt))
continue;
+ if (gimple_clobber_p (stmt))
+ continue;
+
/* FIXME: We can split regions containing EH. We can not however
split RESX, EH_DISPATCH and EH_POINTER referring to same region
into different partitions. This would require tracking of
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 4fd4341..084ab6c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2012-02-23 Jakub Jelinek <jakub@redhat.com>
+
+ PR tree-optimization/52019
+ * gcc.dg/tree-ssa/ipa-split-6.c: New test.
+
2012-02-22 Kai Tietz <ktietz@redhat.com>
* g++.dg/opt/devirt2.C: Add rule for *-*-mingw* target.
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c
new file mode 100644
index 0000000..12070fa
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c
@@ -0,0 +1,10 @@
+/* PR tree-optimization/52019 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -fno-tree-sra -fdump-tree-fnsplit -fdump-tree-optimized" } */
+
+#include "ipa-split-5.c"
+
+/* { dg-final { scan-tree-dump-times "Splitting function" 1 "fnsplit"} } */
+/* { dg-final { cleanup-tree-dump "fnsplit" } } */
+/* { dg-final { scan-tree-dump "part" "optimized"} } */
+/* { dg-final { cleanup-tree-dump "optimized" } } */