* PATCH COMMITTED: PR 32776: lower-subreg remove reg notes on clobbers
@ 2007-08-07 22:47 Ian Lance Taylor
0 siblings, 0 replies; only message in thread
From: Ian Lance Taylor @ 2007-08-07 22:47 UTC (permalink / raw)
To: gcc-patches
PR 32776 is about a case which arises on m32-elf. For some reason in
the test case in the PR (derived from newlib) a clobber will get a
reg_unused note. The lower-subreg pass will decompose the clobbered
register. Unfortunately it will fail to remove the reg note, thus
leaving it pointing at the decomposed concatn rtx. This is unwise,
and causes a crash when using --enable-checking=rtl.
This patch fixes the problem. I also noticed that we no longer need
the local variable "changed" in decompose_multiword_subregs (it's only
use was removed during DF integration), so I removed it.
Bootstrapped and tested on i686-pc-linux-gnu. Committed.
Ian
2007-08-07 Ian Lance Taylor <iant@google.com>
PR rtl-optimization/32776
* lower-subreg.c (resolve_clobber): Call resolve_reg_notes.
(resolve_use): Likewise.
(decompose_multiword_subregs): Remove "changed" local variable.
Index: lower-subreg.c
===================================================================
--- lower-subreg.c (revision 127281)
+++ lower-subreg.c (working copy)
@@ -936,6 +936,8 @@ resolve_clobber (rtx pat, rtx insn)
emit_insn_after (x, insn);
}
+ resolve_reg_notes (insn);
+
return true;
}
@@ -950,6 +952,9 @@ resolve_use (rtx pat, rtx insn)
delete_insn (insn);
return true;
}
+
+ resolve_reg_notes (insn);
+
return false;
}
@@ -1251,25 +1256,17 @@ decompose_multiword_subregs (void)
FOR_BB_INSNS (bb, insn)
{
rtx next, pat;
- bool changed;
if (!INSN_P (insn))
continue;
next = NEXT_INSN (insn);
- changed = false;
pat = PATTERN (insn);
if (GET_CODE (pat) == CLOBBER)
- {
- if (resolve_clobber (pat, insn))
- changed = true;
- }
+ resolve_clobber (pat, insn);
else if (GET_CODE (pat) == USE)
- {
- if (resolve_use (pat, insn))
- changed = true;
- }
+ resolve_use (pat, insn);
else
{
rtx set;
@@ -1302,8 +1299,6 @@ decompose_multiword_subregs (void)
insn = resolve_simple_move (set, insn);
if (insn != orig_insn)
{
- changed = true;
-
remove_retval_note (insn);
recog_memoized (insn);
@@ -1320,7 +1315,6 @@ decompose_multiword_subregs (void)
decomposed_shift = resolve_shift_zext (insn);
if (decomposed_shift != NULL_RTX)
{
- changed = true;
insn = decomposed_shift;
recog_memoized (insn);
extract_insn (insn);
@@ -1349,8 +1343,6 @@ decompose_multiword_subregs (void)
gcc_assert (i);
remove_retval_note (insn);
-
- changed = true;
}
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-07 22:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-07 22:47 PATCH COMMITTED: PR 32776: lower-subreg remove reg notes on clobbers Ian Lance Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).