summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-19 10:27:07 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-07-19 10:27:07 +0000
commita5d536df523c382cc266ab846912060a2a888eca (patch)
tree18a19d1d0d3ba0f9e6bb73f587b8903c2c74a669 /gcc
parent02c01bafd50499be42e2bd94f35531c134d7c7e3 (diff)
downloadgcc-a5d536df523c382cc266ab846912060a2a888eca.tar.gz
PR tree-optimization/40676
* tree-ssa-dce.c (eliminate_unnecessary_stmts): Do renaming on all virtual PHIs in empty BBs. * gcc.c-torture/compile/pr40676.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@149789 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/pr40676.c33
-rw-r--r--gcc/tree-ssa-dce.c6
4 files changed, 48 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8ad42bf6ac5..c88b30b0eaa 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2009-07-19 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/40676
+ * tree-ssa-dce.c (eliminate_unnecessary_stmts): Do renaming on all
+ virtual PHIs in empty BBs.
+
2009-07-18 Adam Nemet <anemet@caviumnetworks.com>
* combine.c (make_compound_operation) <SUBREG>: If force_to_mode
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b1f86982294..6951c22e5bc 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2009-07-19 Jan Hubicka <jh@suse.cz>
+
+ PR tree-optimization/40676
+ * gcc.c-torture/compile/pr40676.c: New testcase.
+
2009-07-18 Adam Nemet <anemet@caviumnetworks.com>
* gcc.target/mips/ext-2.c: New test.
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr40676.c b/gcc/testsuite/gcc.c-torture/compile/pr40676.c
new file mode 100644
index 00000000000..b0426288292
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/pr40676.c
@@ -0,0 +1,33 @@
+extern int f1();
+extern int f2(void*);
+extern void* f3(int);
+int xmsih;
+typedef unsigned short XWCHAR;
+
+inline unsigned int xstrlenW( const XWCHAR *str )
+{
+ const XWCHAR *s = str;
+ while (*s) s++;
+ return s - str;
+}
+
+
+static int msi_dialog_register_class( void )
+{
+ int cls;
+
+ if( !f2( &cls ) )
+ return 0;
+ if( !f2( &cls ) )
+ return 0;
+ xmsih = f1();
+ if( !xmsih )
+ return 0;
+ return 1;
+}
+
+void *xmsi_dialog_create(const XWCHAR* szDialogName)
+{
+ msi_dialog_register_class();
+ return f3(xstrlenW(szDialogName));
+}
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index fdfdda5e95f..86134ad0970 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1137,7 +1137,8 @@ eliminate_unnecessary_stmts (void)
for (bb = ENTRY_BLOCK_PTR->next_bb; bb != EXIT_BLOCK_PTR; bb = next_bb)
{
next_bb = bb->next_bb;
- if (!(bb->flags & BB_REACHABLE))
+ if (!TEST_BIT (bb_contains_live_stmts, bb->index)
+ || !(bb->flags & BB_REACHABLE))
{
for (gsi = gsi_start_phis (bb); !gsi_end_p (gsi); gsi_next (&gsi))
if (!is_gimple_reg (gimple_phi_result (gsi_stmt (gsi))))
@@ -1159,7 +1160,8 @@ eliminate_unnecessary_stmts (void)
if (found)
mark_virtual_phi_result_for_renaming (gsi_stmt (gsi));
}
- delete_basic_block (bb);
+ if (!(bb->flags & BB_REACHABLE))
+ delete_basic_block (bb);
}
}
}