Commit 835b4008 by Nathan Sidwell Committed by Richard Sandiford

200x-xx-xx Nathan Sidwell <nathan@codesourcery.com> Richard Sandiford <richard@codesourcery.com>

gcc/
200x-xx-xx  Nathan Sidwell  <nathan@codesourcery.com>
	    Richard Sandiford  <richard@codesourcery.com>

	* config/m68k/m68k.h (M68K_STATIC_CHAIN_REG_NAME): New macro.
	(INITIALIZE_TRAMPOLINE): Use STATIC_CHAIN_REGNUM.
	(__transfer_from_trampoline): Use M68K_STATIC_CHAIN_REG_NAME.
	* config/m68k/m68kelf.h (STATIC_CHAIN_REGNUM): Override.
	(M68K_STATIC_CHAIN_REG_NAME): Likewise.
	* config/m68k/netbsd-elf.h (M68K_STATIC_CHAIN_REG_NAME): Likewise.

gcc/testsuite/
200x-xx-xx  Nathan Sidwell  <nathan@codesourcery.com>

	* gcc.c-torture/execute/nestfunc-7.c: New.

Co-Authored-By: Richard Sandiford <richard@codesourcery.com>

From-SVN: r120964
parent b6d2f42e
2007-01-19 Nathan Sidwell <nathan@codesourcery.com>
Richard Sandiford <richard@codesourcery.com>
* config/m68k/m68k.h (M68K_STATIC_CHAIN_REG_NAME): New macro.
(INITIALIZE_TRAMPOLINE): Use STATIC_CHAIN_REGNUM.
(__transfer_from_trampoline): Use M68K_STATIC_CHAIN_REG_NAME.
* config/m68k/m68kelf.h (STATIC_CHAIN_REGNUM): Override.
(M68K_STATIC_CHAIN_REG_NAME): Likewise.
* config/m68k/netbsd-elf.h (M68K_STATIC_CHAIN_REG_NAME): Likewise.
2007-01-19 Richard Sandiford <richard@codesourcery.com>
* config/m68k/m68k.md (adddi_dilshr32): Rename to...
......
......@@ -432,6 +432,7 @@ Boston, MA 02110-1301, USA. */
#define ARG_POINTER_REGNUM 24
#define STATIC_CHAIN_REGNUM 8
#define M68K_STATIC_CHAIN_REG_NAME REGISTER_PREFIX "a0"
/* Register in which address to store a structure value
is passed to a function. */
......@@ -684,7 +685,8 @@ extern enum reg_class regno_reg_class[];
jmp FNADDR */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
emit_move_insn (gen_rtx_MEM (HImode, TRAMP), GEN_INT(0x207C)); \
emit_move_insn (gen_rtx_MEM (HImode, TRAMP), \
GEN_INT(0x207C + ((STATIC_CHAIN_REGNUM-8) << 9))); \
emit_move_insn (gen_rtx_MEM (SImode, plus_constant (TRAMP, 2)), CXT); \
emit_move_insn (gen_rtx_MEM (HImode, plus_constant (TRAMP, 6)), \
GEN_INT(0x4EF9)); \
......@@ -707,7 +709,7 @@ extern enum reg_class regno_reg_class[];
void \
__transfer_from_trampoline () \
{ \
register char *a0 asm ("%a0"); \
register char *a0 asm (M68K_STATIC_CHAIN_REG_NAME); \
asm (GLOBAL_ASM_OP "___trampoline"); \
asm ("___trampoline:"); \
asm volatile ("move%.l %0,%@" : : "m" (a0[22])); \
......
......@@ -83,6 +83,14 @@ do { \
#undef M68K_STRUCT_VALUE_REGNUM
#define M68K_STRUCT_VALUE_REGNUM 8
/* The static chain regnum defaults to a0, but we use that for
structure return, so have to use a1 for the static chain. */
#undef STATIC_CHAIN_REGNUM
#define STATIC_CHAIN_REGNUM 9
#undef M68K_STATIC_CHAIN_REG_NAME
#define M68K_STATIC_CHAIN_REG_NAME REGISTER_PREFIX "a1"
#define ASM_COMMENT_START "|"
/* Define how the m68k registers should be numbered for Dwarf output.
......
......@@ -233,6 +233,8 @@ while (0)
#undef STATIC_CHAIN_REGNUM
#define STATIC_CHAIN_REGNUM 9
#undef M68K_STATIC_CHAIN_REG_NAME
#define M68K_STATIC_CHAIN_REG_NAME REGISTER_PREFIX "a1"
/* Now to renumber registers for dbx and gdb.
......
2007-01-19 Nathan Sidwell <nathan@codesourcery.com>
* gcc.c-torture/execute/nestfunc-7.c: New.
2007-01-18 Hui-May Chang <hm.chang@apple.com>
* gcc.c-torture/compile/pr27528.c: Add -fno-pic option.
struct A
{
int one;
int two;
int three;
int four;
int five;
int six;
};
static int test (void)
{
int base;
struct A Foo (void)
{
struct A a;
a.one = base + 1;
a.two = base + 2;
a.three = base + 3;
a.four = base + 4;
a.five = base + 5;
a.six = base + 6;
return a;
}
base = 10;
struct A a = Foo ();
return (a.one == 11
&& a.two == 12
&& a.three == 13
&& a.four == 14
&& a.five == 15
&& a.six == 16);
}
int main (void)
{
return !test ();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment