aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2005-01-14 11:50:18 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2005-01-14 11:50:18 +0100
commit08a0c536dffd810a5565d149bfd216df684c788e (patch)
treea1913e93e194d26049b54e754c3bab349f78f636 /gcc/recog.c
parenta0afbdb682e3ae83ae087a69f3a975ad23582069 (diff)
downloadgcc-08a0c536dffd810a5565d149bfd216df684c788e.zip
gcc-08a0c536dffd810a5565d149bfd216df684c788e.tar.gz
gcc-08a0c536dffd810a5565d149bfd216df684c788e.tar.bz2
re PR middle-end/19084 (ICE: internal consistency failure)
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. From-SVN: r93639
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 09a98f2..6fc3cf9 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
{