aboutsummaryrefslogtreecommitdiff
path: root/gcc/ira.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>2011-06-23 15:30:20 -0600
committerJeff Law <law@gcc.gnu.org>2011-06-23 15:30:20 -0600
commitb0c11403d6546563d66be42922b1606572aec255 (patch)
treeec001f94b4dc1405030f08d6e85ac05f217a3e9a /gcc/ira.c
parent49e9c661145c32c17dff2c364de890c0ca46225e (diff)
downloadgcc-b0c11403d6546563d66be42922b1606572aec255.zip
gcc-b0c11403d6546563d66be42922b1606572aec255.tar.gz
gcc-b0c11403d6546563d66be42922b1606572aec255.tar.bz2
re PR middle-end/48770 (wrong code with -O -fprofile-arcs -fPIC -fno-dce -fno-forward-propagate -fno-tree-forwprop)
PR middle-end/48770 * reload.h (reload): Change to return a bool. * ira.c (ira): If requested by reload, run a fast DCE pass after reload has completed. Fix comment typo. * reload1.c (need_dce): New file scoped static. (reload): Set reload_completed here. Return whether or not a DCE pass after reload is needed. (delete_dead_insn): Set need_dce as needed. PR middle-end/48770 * gcc.dg/pr48770.c: New test. From-SVN: r175353
Diffstat (limited to 'gcc/ira.c')
-rw-r--r--gcc/ira.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/ira.c b/gcc/ira.c
index 5cfe5c0..6cca908 100644
--- a/gcc/ira.c
+++ b/gcc/ira.c
@@ -383,6 +383,7 @@ along with GCC; see the file COPYING3. If not see
#include "integrate.h"
#include "ggc.h"
#include "ira-int.h"
+#include "dce.h"
struct target_ira default_target_ira;
@@ -3526,6 +3527,7 @@ ira (FILE *f)
int rebuild_p;
int saved_flag_ira_share_spill_slots;
basic_block bb;
+ bool need_dce;
timevar_push (TV_IRA);
@@ -3717,7 +3719,7 @@ ira (FILE *f)
df_set_flags (DF_NO_INSN_RESCAN);
build_insn_chain ();
- reload_completed = !reload (get_insns (), ira_conflicts_p);
+ need_dce = reload (get_insns (), ira_conflicts_p);
timevar_pop (TV_RELOAD);
@@ -3760,7 +3762,7 @@ ira (FILE *f)
#endif
/* The code after the reload has changed so much that at this point
- we might as well just rescan everything. Not that
+ we might as well just rescan everything. Note that
df_rescan_all_insns is not going to help here because it does not
touch the artificial uses and defs. */
df_finish_pass (true);
@@ -3772,6 +3774,9 @@ ira (FILE *f)
if (optimize)
df_analyze ();
+ if (need_dce && optimize)
+ run_fast_dce ();
+
timevar_pop (TV_IRA);
}