From 08a0c536dffd810a5565d149bfd216df684c788e Mon Sep 17 00:00:00 2001 From: Jakub Jelinek Date: Fri, 14 Jan 2005 11:50:18 +0100 Subject: 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 --- gcc/recog.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'gcc/recog.c') 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 { -- cgit v1.1