aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey A Law <law@cygnus.com>2000-01-14 09:28:10 +0000
committerJeff Law <law@gcc.gnu.org>2000-01-14 02:28:10 -0700
commit254a8f0dbe961f94d6e23ae7ba013afd67dfc7a0 (patch)
tree6d003ccced778fcf56c848339488708e9294935f
parentb2eadaa20146c45631e6cc9ffef0bb2a65748241 (diff)
downloadgcc-254a8f0dbe961f94d6e23ae7ba013afd67dfc7a0.zip
gcc-254a8f0dbe961f94d6e23ae7ba013afd67dfc7a0.tar.gz
gcc-254a8f0dbe961f94d6e23ae7ba013afd67dfc7a0.tar.bz2
fr30.h (TRAMPOLINE_TEMPLATE): Use nops to ensure the static chain and destination functions are 32bit aligned...
* fr30.h (TRAMPOLINE_TEMPLATE): Use nops to ensure the static chain and destination functions are 32bit aligned within the trampoline. (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes. (TRAMPOLINE_ALIGNMENT): Define. From-SVN: r31409
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/fr30/fr30.h22
2 files changed, 23 insertions, 4 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 08ce9e2..c52c015 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
Fri Jan 14 00:28:06 2000 Jeffrey A Law (law@cygnus.com)
+ * fr30.h (TRAMPOLINE_TEMPLATE): Use nops to ensure the static chain
+ and destination functions are 32bit aligned within the trampoline.
+ (TRAMPOLINE_SIZE, INITIALIZE_TRAMPOLINE): Corresponding changes.
+ (TRAMPOLINE_ALIGNMENT): Define.
+
* cse.c (cse_insn): When changing (set (pc) (reg)) to
(set (pc) (label_ref)), verify the change creates a valid insn.
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index f28ab37..b7ea8b2 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -1139,22 +1139,36 @@ typedef int CUMULATIVE_ARGS;
/* On the FR30, the trampoline is:
+ nop
ldi:32 STATIC, r12
+ nop
ldi:32 FUNCTION, r0
- jmp @r0 */
+ jmp @r0
+
+ The no-ops are to guarantee that the the static chain and final
+ target are 32 bit ailgned within the trampoline. That allows us to
+ initialize those locations with simple SImode stores. The alternative
+ would be to use HImode stores. */
/* A C statement to output, on the stream FILE, assembler code for a block of
data that contains the constant parts of a trampoline. This code should not
include a label--the label is taken care of automatically. */
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
+ fprintf (FILE, "\tnop\n"); \
fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [STATIC_CHAIN_REGNUM]); \
+ fprintf (FILE, "\tnop\n"); \
fprintf (FILE, "\tldi:32\t#0, %s\n", reg_names [COMPILER_SCRATCH_REGISTER]); \
fprintf (FILE, "\tjmp\t@%s\n", reg_names [COMPILER_SCRATCH_REGISTER]); \
}
/* A C expression for the size in bytes of the trampoline, as an integer. */
-#define TRAMPOLINE_SIZE 14
+#define TRAMPOLINE_SIZE 18
+
+/* We want the trampoline to be aligned on a 32bit boundary so that we can
+ make sure the location of the static chain & target function within
+ the trampoline is also aligned on a 32bit boundary. */
+#define TRAMPOLINE_ALIGNMENT 32
/* A C statement to initialize the variable parts of a trampoline. ADDR is an
RTX for the address of the trampoline; FNADDR is an RTX for the address of
@@ -1163,8 +1177,8 @@ typedef int CUMULATIVE_ARGS;
#define INITIALIZE_TRAMPOLINE(ADDR, FNADDR, STATIC_CHAIN) \
do \
{ \
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (ADDR, 2)), STATIC_CHAIN);\
- emit_move_insn (gen_rtx (MEM, SImode, plus_constant (ADDR, 8)), FNADDR); \
+ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (ADDR, 4)), STATIC_CHAIN);\
+ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (ADDR, 12)), FNADDR); \
} while (0);
/*}}}*/