diff options
author | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-25 17:32:44 +0000 |
---|---|---|
committer | danglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-07-25 17:32:44 +0000 |
commit | 874e20e3322a6385035be68d389f705e41c2fdb0 (patch) | |
tree | 3c209778953db0f883ee68c0067a525108e35f04 /gcc/cselib.c | |
parent | 908212941bbc40b03fb96e50a2f2a207ef7e0807 (diff) | |
download | gcc-874e20e3322a6385035be68d389f705e41c2fdb0.tar.gz |
PR middle-end/71732
* cselib.c (cselib_process_insn): Invalidate argument slots for
const/pure calls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@238727 138bc75d-0d04-0410-961f-82ee72b054a4
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 14c7b320b03..0c5183cf730 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); |