OSDN Git Service

* pa.h (TRAMPOLINE_TEMPLATE): Add two words to the template for
authordanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Sep 2001 16:21:09 +0000 (16:21 +0000)
committerdanglin <danglin@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 24 Sep 2001 16:21:09 +0000 (16:21 +0000)
non 64-bit machines.  Use these as a plabel for the trampoline.
(TRAMPOLINE_SIZE): Adjust size for new words.
(INITIALIZE_TRAMPOLINE): Initialize new words.
(TRAMPOLINE_ADJUST_ADDRESS): New.  Adjust address to make it a
pointer to the plabel in the trampoline.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@45776 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/config/pa/pa.h

index 172e5c9..d526acf 100644 (file)
@@ -1,5 +1,14 @@
 2001-09-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
 
+       * pa.h (TRAMPOLINE_TEMPLATE): Add two words to the template for
+       non 64-bit machines.  Use these as a plabel for the trampoline.
+       (TRAMPOLINE_SIZE): Adjust size for new words.
+       (INITIALIZE_TRAMPOLINE): Initialize new words.
+       (TRAMPOLINE_ADJUST_ADDRESS): New.  Adjust address to make it a
+       pointer to the plabel in the trampoline.
+
+2001-09-24  John David Anglin  <dave@hiauly1.hia.nrc.ca>
+
        * pa.c (function_arg): Pass floating arguments in both general and
        floating registers in indirect (dynamic) calls when generating code
        for the 32 bit ABI and the HP assembler.
index fa892f1..09f5bbc 100644 (file)
@@ -922,6 +922,8 @@ extern int may_call_alloca;
        fputs ("\tldw   40(%r22),%r29\n", FILE);                        \
        fputs ("\t.word 0\n", FILE);                                    \
        fputs ("\t.word 0\n", FILE);                                    \
+       fputs ("\t.word 0\n", FILE);                                    \
+       fputs ("\t.word 0\n", FILE);                                    \
       }                                                                        \
     else                                                               \
       {                                                                        \
@@ -949,14 +951,17 @@ extern int may_call_alloca;
    If the code part of the trampoline ever grows to > 32 bytes, then it
    will become necessary to hack on the cacheflush pattern in pa.md.  */
 
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 11 * 4)
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
 
 /* Emit RTL insns to initialize the variable parts of a trampoline.
    FNADDR is an RTX for the address of the function's pure code.
    CXT is an RTX for the static chain value for the function.
 
-   Move the function address to the trampoline template at offset 12.
-   Move the static chain value to trampoline template at offset 16.  */
+   Move the function address to the trampoline template at offset 36.
+   Move the static chain value to trampoline template at offset 40.
+   Move the trampoline address to trampoline template at offset 44.
+   Move r19 to trampoline template at offset 48.  The latter two
+   words create a plabel for the indirect call to the trampoline.  */
 
 #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT)                      \
 {                                                                      \
@@ -968,6 +973,11 @@ extern int may_call_alloca;
       emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR));      \
       start_addr = memory_address (Pmode, plus_constant ((TRAMP), 40));        \
       emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT));         \
+      start_addr = memory_address (Pmode, plus_constant ((TRAMP), 44));        \
+      emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (TRAMP));       \
+      start_addr = memory_address (Pmode, plus_constant ((TRAMP), 48));        \
+      emit_move_insn (gen_rtx_MEM (Pmode, start_addr),                 \
+                     gen_rtx_REG (Pmode, 19));                         \
       /* fdc and fic only use registers for the address to flush,      \
         they do not accept integer displacements.  */                  \
       start_addr = force_reg (Pmode, (TRAMP));                         \
@@ -1003,6 +1013,13 @@ extern int may_call_alloca;
     }                                                                  \
 }
 
+/* Perform any machine-specific adjustment in the address of the trampoline.
+   ADDR contains the address that was passed to INITIALIZE_TRAMPOLINE.
+   Adjust the trampoline address to point to the plabel at offset 44.  */
+   
+#define TRAMPOLINE_ADJUST_ADDRESS(ADDR) \
+  if (!TARGET_64BIT) (ADDR) = memory_address (Pmode, plus_constant ((ADDR), 46))
+
 /* Emit code for a call to builtin_saveregs.  We must emit USE insns which
    reference the 4 integer arg registers and 4 fp arg registers.
    Ordinarily they are not call used registers, but they are for