summaryrefslogtreecommitdiff
path: root/gcc/gcse.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-04 15:19:19 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-11-04 15:19:19 +0000
commit805e3e15bb9db8d0946fa36ac619bffc3af8dac8 (patch)
treef3eb52d8af926dd9719f0f6e47ce85a8efb2f2f9 /gcc/gcse.c
parent8b5e99f041c643a6f7c5ae3cc7f8a7540fb75c37 (diff)
downloadgcc-805e3e15bb9db8d0946fa36ac619bffc3af8dac8.tar.gz
2010-11-04 Richard Guenther <rguenther@suse.de>
PR rtl-optimization/46183 * gcse.c (execute_rtl_cprop): Cleanup the CFG if something changed. (execute_rtl_pre): Likewise. (execute_rtl_hoist): Likewise. * gcc.dg/torture/pr46183.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@166316 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcse.c')
-rw-r--r--gcc/gcse.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 70f0fac0ed4..595fdb2b054 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -5246,10 +5246,14 @@ gate_rtl_cprop (void)
static unsigned int
execute_rtl_cprop (void)
{
+ int changed;
delete_unreachable_blocks ();
df_set_flags (DF_LR_RUN_DCE);
df_analyze ();
- flag_rerun_cse_after_global_opts |= one_cprop_pass ();
+ changed = one_cprop_pass ();
+ flag_rerun_cse_after_global_opts |= changed;
+ if (changed)
+ cleanup_cfg (0);
return 0;
}
@@ -5265,9 +5269,13 @@ gate_rtl_pre (void)
static unsigned int
execute_rtl_pre (void)
{
+ int changed;
delete_unreachable_blocks ();
df_analyze ();
- flag_rerun_cse_after_global_opts |= one_pre_gcse_pass ();
+ changed = one_pre_gcse_pass ();
+ flag_rerun_cse_after_global_opts |= changed;
+ if (changed)
+ cleanup_cfg (0);
return 0;
}
@@ -5286,9 +5294,13 @@ gate_rtl_hoist (void)
static unsigned int
execute_rtl_hoist (void)
{
+ int changed;
delete_unreachable_blocks ();
df_analyze ();
- flag_rerun_cse_after_global_opts |= one_code_hoisting_pass ();
+ changed = one_code_hoisting_pass ();
+ flag_rerun_cse_after_global_opts |= changed;
+ if (changed)
+ cleanup_cfg (0);
return 0;
}