OSDN Git Service

PR tree-optimization/52019
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2012 14:43:43 +0000 (14:43 +0000)
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 23 Feb 2012 14:43:43 +0000 (14:43 +0000)
* ipa-split.c (find_return_bb, find_retval, visit_bb): Ignore
CLOBBER stmts.

* gcc.dg/tree-ssa/ipa-split-6.c: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184508 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/ipa-split.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/tree-ssa/ipa-split-6.c [new file with mode: 0644]

index 11d53e0..8900009 100644 (file)
@@ -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
index 124098c..cb35150 100644 (file)
@@ -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
index 4fd4341..084ab6c 100644 (file)
@@ -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 (file)
index 0000000..12070fa
--- /dev/null
@@ -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" } } */