aboutsummaryrefslogtreecommitdiff
path: root/gcc/postreload.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-13 02:05:31 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-13 02:05:31 -0700
commit0d87c765251e8619f4eb86894bdcf109367d0274 (patch)
treec07f98b7d57da963ba6c6d9edd7cb156910bc1e4 /gcc/postreload.c
parentddef210a8919486d2d9f9b65c914435a39b21060 (diff)
downloadgcc-0d87c765251e8619f4eb86894bdcf109367d0274.zip
gcc-0d87c765251e8619f4eb86894bdcf109367d0274.tar.gz
gcc-0d87c765251e8619f4eb86894bdcf109367d0274.tar.bz2
re PR inline-asm/6806 (gcc 3.0.4 ignoring clobbered registers in inline asm with -O1 or higher on i386)
PR inline-asm/6806 * cselib.c (cselib_invalidate_rtx): Export. Remove unused args. (cselib_invalidate_rtx_note_stores): New. (cselib_record_sets, cselib_process_insn): Update to match. * cselib.h (cselib_invalidate_rtx): Declare. * postreload.c (reload_cse_simplify): Invalidate asm clobbers. From-SVN: r87432
Diffstat (limited to 'gcc/postreload.c')
-rw-r--r--gcc/postreload.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/postreload.c b/gcc/postreload.c
index 20d4a4f..2ff95b1 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -118,6 +118,19 @@ reload_cse_simplify (rtx insn, rtx testreg)
int count = 0;
rtx value = NULL_RTX;
+ /* Registers mentioned in the clobber list for an asm cannot be reused
+ within the body of the asm. Invalidate those registers now so that
+ we don't try to substitute values for them. */
+ if (asm_noperands (body) >= 0)
+ {
+ for (i = XVECLEN (body, 0) - 1; i >= 0; --i)
+ {
+ rtx part = XVECEXP (body, 0, i);
+ if (GET_CODE (part) == CLOBBER && REG_P (XEXP (part, 0)))
+ cselib_invalidate_rtx (XEXP (part, 0));
+ }
+ }
+
/* If every action in a PARALLEL is a noop, we can delete
the entire PARALLEL. */
for (i = XVECLEN (body, 0) - 1; i >= 0; --i)