diff options
author | John David Anglin <danglin@gcc.gnu.org> | 2016-07-25 17:32:44 +0000 |
---|---|---|
committer | John David Anglin <danglin@gcc.gnu.org> | 2016-07-25 17:32:44 +0000 |
commit | 007b405bbfa20787eb15a110ce250989d0467622 (patch) | |
tree | 3c209778953db0f883ee68c0067a525108e35f04 /gcc/cselib.c | |
parent | 7d575fffd2e517cbe497780db8e262ed7a350a3a (diff) | |
download | gcc-007b405bbfa20787eb15a110ce250989d0467622.zip gcc-007b405bbfa20787eb15a110ce250989d0467622.tar.gz gcc-007b405bbfa20787eb15a110ce250989d0467622.tar.bz2 |
re PR middle-end/71732 (FAIL: gcc.dg/torture/pr71532.c at -O2 and above)
PR middle-end/71732
* cselib.c (cselib_process_insn): Invalidate argument slots for
const/pure calls.
From-SVN: r238727
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r-- | gcc/cselib.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c index 14c7b32..0c5183c 100644 --- a/gcc/cselib.c +++ b/gcc/cselib.c @@ -2659,6 +2659,13 @@ cselib_process_insn (rtx_insn *insn) if (RTL_LOOPING_CONST_OR_PURE_CALL_P (insn) || !(RTL_CONST_OR_PURE_CALL_P (insn))) cselib_invalidate_mem (callmem); + else + /* For const/pure calls, invalidate any argument slots because + they are owned by the callee. */ + for (x = CALL_INSN_FUNCTION_USAGE (insn); x; x = XEXP (x, 1)) + if (GET_CODE (XEXP (x, 0)) == USE + && MEM_P (XEXP (XEXP (x, 0), 0))) + cselib_invalidate_mem (XEXP (XEXP (x, 0), 0)); } cselib_record_sets (insn); |