This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RFA:] fix PR41064, miss in fix for PR37053 in reload_as_needed.
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 14 Aug 2009 12:31:40 +0200
- Subject: [RFA:] fix PR41064, miss in fix for PR37053 in reload_as_needed.
The revision 150626 was missing a difference between
validate_replace_rtx and validate_replace_rtx_group: the former
checks and changes back the replacements if they check out as
invalid already then (i.e. invalid_object_p yields true). This
matters because the immediately following call to extract_insn
causes an ICE for an insn that can't be recognized. This is
fixed by the following patch, just moving the extract_insn so it
isn't called for replacements with this kind of early failure.
Tested cris-elf; results back to those of 150625 (plus Richard
Sandiford's patch to fix the "earlier" bug, later committed).
See also the trail of PR41064.
Ok to commit?
gcc:
* reload1.c (reload_as_needed): Don't call extract_insn
for known invalid replacements after calling
validate_replace_rtx_group and verify_changes.
Index: gcc/reload1.c
===================================================================
--- gcc/reload1.c (revision 150626)
+++ gcc/reload1.c (working copy)
@@ -4312,10 +4312,15 @@
n = verify_changes (0);
/* We must also verify that the constraints
- are met after the replacement. */
- extract_insn (p);
+ are met after the replacement. Make sure
+ extract_insn is only called for an insn
+ where the replacements were found to be
+ valid so far. */
if (n)
- n = constrain_operands (1);
+ {
+ extract_insn (p);
+ n = constrain_operands (1);
+ }
/* If the constraints were not met, then
undo the replacement, else confirm it. */
brgds, H-P