diff options
author | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-24 23:52:16 +0000 |
---|---|---|
committer | amylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4> | 2002-04-24 23:52:16 +0000 |
commit | bd54bbc6b07e081013f7996a9239f15f62e7719d (patch) | |
tree | 1fd83762c98ea87999142b9608c409960384d4f7 /gcc/loop.c | |
parent | 882549f1509905a43de2dbd2f422efc7ced7eee5 (diff) | |
download | gcc-bd54bbc6b07e081013f7996a9239f15f62e7719d.tar.gz |
* loop.c (load_mems): Don't change the interface of called functions.
* calls.c (expand_call): Take current_function_pretend_args_size
into account when setting argblock for sibcalls.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@52745 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/loop.c')
-rw-r--r-- | gcc/loop.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/gcc/loop.c b/gcc/loop.c index b9997dae701..5f187736c4b 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -9784,9 +9784,20 @@ load_mems (loop) && rtx_equal_p (SET_DEST (set), mem)) SET_REGNO_REG_SET (&store_copies, REGNO (SET_SRC (set))); - /* Replace the memory reference with the shadow register. */ - replace_loop_mems (p, loop_info->mems[i].mem, - loop_info->mems[i].reg); + /* If this is a call which uses / clobbers this memory + location, we must not change the interface here. */ + if (GET_CODE (p) == CALL_INSN + && reg_mentioned_p (loop_info->mems[i].mem, + CALL_INSN_FUNCTION_USAGE (p))) + { + cancel_changes (0); + loop_info->mems[i].optimize = 0; + break; + } + else + /* Replace the memory reference with the shadow register. */ + replace_loop_mems (p, loop_info->mems[i].mem, + loop_info->mems[i].reg); } if (GET_CODE (p) == CODE_LABEL @@ -9794,7 +9805,9 @@ load_mems (loop) maybe_never = 1; } - if (! apply_change_group ()) + if (! loop_info->mems[i].optimize) + ; /* We found we couldn't do the replacement, so do nothing. */ + else if (! apply_change_group ()) /* We couldn't replace all occurrences of the MEM. */ loop_info->mems[i].optimize = 0; else |