From: Jeffrey A Law Date: Fri, 14 Jan 2000 09:28:10 +0000 (+0000) Subject: fr30.h (TRAMPOLINE_TEMPLATE): Use nops to ensure the static chain and destination... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=254a8f0dbe961f94d6e23ae7ba013afd67dfc7a0;p=gcc.git 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 08ce9e2e328..c52c015d940 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 f28ab374da2..b7ea8b2239e 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); /*}}}*/