diff options
author | J"orn Rennecke <joern.rennecke@superh.com> | 2002-04-24 23:52:16 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2002-04-25 00:52:16 +0100 |
commit | fcae219ac449243231ebbe73eefddde824d7354b (patch) | |
tree | 1fd83762c98ea87999142b9608c409960384d4f7 /gcc | |
parent | 0df9cfc799b0ff8a62f076bac4725a961f88ada2 (diff) | |
download | gcc-fcae219ac449243231ebbe73eefddde824d7354b.zip gcc-fcae219ac449243231ebbe73eefddde824d7354b.tar.gz gcc-fcae219ac449243231ebbe73eefddde824d7354b.tar.bz2 |
loop.c (load_mems): Don't change the interface of called functions.
* 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.
From-SVN: r52745
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/calls.c | 6 | ||||
-rw-r--r-- | gcc/loop.c | 21 |
3 files changed, 30 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a090b49..37e68d7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +Wed Apr 24 23:45:37 2002 J"orn Rennecke <joern.rennecke@superh.com> + + * 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. + 2002-04-24 Matt Hiller <hiller@redhat.com> * cpplex.c: Remove conditional #undef of MULTIBYTE_CHARS. diff --git a/gcc/calls.c b/gcc/calls.c index a6c622c..6a95686 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -2709,6 +2709,12 @@ expand_call (exp, target, ignore) if (pass == 0) { argblock = virtual_incoming_args_rtx; + argblock +#ifdef STACK_GROWS_DOWNWARD + = plus_constant (argblock, current_function_pretend_args_size); +#else + = plus_constant (argblock, -current_function_pretend_args_size); +#endif stored_args_map = sbitmap_alloc (args_size.constant); sbitmap_zero (stored_args_map); } @@ -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 |