diff options
author | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-13 09:05:31 +0000 |
---|---|---|
committer | rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-09-13 09:05:31 +0000 |
commit | 1788348987b52f26864dc4ea4ac0734e92d484aa (patch) | |
tree | c07f98b7d57da963ba6c6d9edd7cb156910bc1e4 /gcc/postreload.c | |
parent | 70743d82522c87de7e4c24f00cb452c1ba1cd88f (diff) | |
download | gcc-1788348987b52f26864dc4ea4ac0734e92d484aa.tar.gz |
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
Diffstat (limited to 'gcc/postreload.c')
-rw-r--r-- | gcc/postreload.c | 13 |
1 files changed, 13 insertions, 0 deletions
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) |