aboutsummaryrefslogtreecommitdiff
path: root/gcc/config/alpha
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-07-01 23:31:49 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-07-01 23:31:49 -0700
commit229aa352300d92a4cd3061d3fedd4b45a3052ca9 (patch)
tree6dfbf23bd42bd6ba9771dc47df56a47f3f693ab8 /gcc/config/alpha
parent8260c194b7ee859e189226d198f84defc373f8d2 (diff)
downloadgcc-229aa352300d92a4cd3061d3fedd4b45a3052ca9.zip
gcc-229aa352300d92a4cd3061d3fedd4b45a3052ca9.tar.gz
gcc-229aa352300d92a4cd3061d3fedd4b45a3052ca9.tar.bz2
alpha.c (struct machine_function): Add gp_save_rtx.
* config/alpha/alpha.c (struct machine_function): Add gp_save_rtx. (alpha_gp_save_rtx): Use assign_stack_local instead of gen_mem_addressof. From-SVN: r84015
Diffstat (limited to 'gcc/config/alpha')
-rw-r--r--gcc/config/alpha/alpha.c27
1 files changed, 22 insertions, 5 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 66c8df1..23f35eb 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -5189,6 +5189,9 @@ struct machine_function GTY(())
/* For OSF. */
const char *some_ld_name;
+
+ /* For TARGET_LD_BUGGY_LDGP. */
+ struct rtx_def *gp_save_rtx;
};
/* How to allocate a 'struct machine_function'. */
@@ -5213,16 +5216,30 @@ alpha_return_addr (int count, rtx frame ATTRIBUTE_UNUSED)
return get_hard_reg_initial_val (Pmode, REG_RA);
}
-/* Return or create a pseudo containing the gp value for the current
+/* Return or create a memory slot containing the gp value for the current
function. Needed only if TARGET_LD_BUGGY_LDGP. */
rtx
alpha_gp_save_rtx (void)
{
- rtx r = get_hard_reg_initial_val (DImode, 29);
- if (GET_CODE (r) != MEM)
- r = gen_mem_addressof (r, NULL_TREE, /*rescan=*/true);
- return r;
+ rtx seq, m = cfun->machine->gp_save_rtx;
+
+ if (m == NULL)
+ {
+ start_sequence ();
+
+ m = assign_stack_local (DImode, UNITS_PER_WORD, BITS_PER_WORD);
+ m = validize_mem (m);
+ emit_move_insn (m, pic_offset_table_rtx);
+
+ seq = get_insns ();
+ end_sequence ();
+ emit_insn_after (seq, entry_of_function ());
+
+ cfun->machine->gp_save_rtx = m;
+ }
+
+ return m;
}
static int