From 1788348987b52f26864dc4ea4ac0734e92d484aa Mon Sep 17 00:00:00 2001 From: rth Date: Mon, 13 Sep 2004 09:05:31 +0000 Subject: 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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@87432 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/postreload.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gcc/postreload.c') diff --git a/gcc/postreload.c b/gcc/postreload.c index 20d4a4f543e..2ff95b1a4a7 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) -- cgit v1.2.1