diff options
author | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-08 17:08:00 -0400 |
---|---|---|
committer | Richard Kenner <kenner@gcc.gnu.org> | 1994-08-08 17:08:00 -0400 |
commit | ac9e20f0fb74ccf91c03f52544f54177fd049810 (patch) | |
tree | 0d899b78a6a01b5f807a5e67a45ffed65efe6acd /gcc | |
parent | 580d3230435c471a2f45d7d7e0789b6373f167c2 (diff) | |
download | gcc-ac9e20f0fb74ccf91c03f52544f54177fd049810.zip gcc-ac9e20f0fb74ccf91c03f52544f54177fd049810.tar.gz gcc-ac9e20f0fb74ccf91c03f52544f54177fd049810.tar.bz2 |
(expand_function_start): Only use static_chain_incoming_rtx once if it
is a REG and we have SMALL_REGISTER_CLASSES.
From-SVN: r7873
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/function.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/gcc/function.c b/gcc/function.c index 4650548d..e482f1d 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -4965,11 +4965,20 @@ expand_function_start (subr, parms_have_cleanups) /* Fetch static chain values for containing functions. */ tem = decl_function_context (current_function_decl); - /* If not doing stupid register allocation, then start off with the static - chain pointer in a pseudo register. Otherwise, we use the stack - address that was generated above. */ + /* If not doing stupid register allocation copy the static chain + pointer into a psuedo. If we have small register classes, copy the + value from memory if static_chain_incoming_rtx is a REG. If we do + stupid register allocation, we use the stack address generated above. */ if (tem && ! obey_regdecls) - last_ptr = copy_to_reg (static_chain_incoming_rtx); + { +#ifdef SMALL_REGISTER_CLASSES + if (GET_CODE (static_chain_incoming_rtx) == REG) + last_ptr = copy_to_reg (last_ptr); + else +#endif + last_ptr = copy_to_reg (static_chain_incoming_rtx); + } + context_display = 0; while (tem) { |