summaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-14 10:50:18 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-14 10:50:18 +0000
commitab2bed1346a4d59299ad6cf5528d350de7ac9380 (patch)
treea1913e93e194d26049b54e754c3bab349f78f636 /gcc/recog.c
parente8da44db5031f41a0a693b3b1a9f9e7d86a2a9c5 (diff)
downloadgcc-ab2bed1346a4d59299ad6cf5528d350de7ac9380.tar.gz
PR middle-end/19084
PR rtl-optimization/19348 * recog.c (peephole2_optimize): Do global life update if some peephole decides it doesn't need at least one of its inputs and that change influences liveness at the start of the basic block. * basic-block.h (EXECUTE_IF_AND_COMPL_IN_REG_SET): Needs 2 REGSET arguments instead of 1. * gcc.dg/20050111-1.c: New test. * gcc.c-torture/execute/20050111-1.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@93639 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/recog.c')
-rw-r--r--gcc/recog.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/recog.c b/gcc/recog.c
index 09a98f2e33f..6fc3cf9ad64 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -2968,6 +2968,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
bool changed;
#endif
bool do_cleanup_cfg = false;
+ bool do_global_life_update = false;
bool do_rebuild_jump_labels = false;
/* Initialize the regsets we're going to use. */
@@ -2986,6 +2987,8 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
FOR_EACH_BB_REVERSE (bb)
{
struct propagate_block_info *pbi;
+ reg_set_iterator rsi;
+ unsigned int j;
/* Indicate that all slots except the last holds invalid data. */
for (i = 0; i < MAX_INSNS_PER_PEEP2; ++i)
@@ -3207,6 +3210,15 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
break;
}
+ /* Some peepholes can decide the don't need one or more of their
+ inputs. If this happens, local life update is not enough. */
+ EXECUTE_IF_AND_COMPL_IN_BITMAP (bb->global_live_at_start, live,
+ 0, j, rsi)
+ {
+ do_global_life_update = true;
+ break;
+ }
+
free_propagate_block_info (pbi);
}
@@ -3223,8 +3235,10 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
if (do_cleanup_cfg)
{
cleanup_cfg (0);
- update_life_info (0, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
+ do_global_life_update = true;
}
+ if (do_global_life_update)
+ update_life_info (0, UPDATE_LIFE_GLOBAL_RM_NOTES, PROP_DEATH_NOTES);
#ifdef HAVE_conditional_execution
else
{