* [Comitted] S/390: Fix static chain trampolines with -m31 -mzarch
@ 2011-05-06 11:18 Andreas Krebbel
0 siblings, 0 replies; only message in thread
From: Andreas Krebbel @ 2011-05-06 11:18 UTC (permalink / raw)
To: gcc-patches
Hi,
the attached patch fixes a problem with trampolines in -m31 -mzarch
mode. The elements of the trampoline are pointer size entities so
they have to depend on -m31/-m64 (UNITS_PER_LONG) but not on
-mesa/-mzarch (UNITS_PER_WORD). Fixed with the attached patch.
Committed to mainline and 4.6.
Bye,
-Andreas-
2011-05-06 Andreas Krebbel <Andreas.Krebbel@de.ibm.com>
* config/s390/s390.c (s390_asm_trampoline_template): Comment
instruction sizes.
(s390_trampoline_init): Replace UNITS_PER_WORD with
UNITS_PER_LONG.
Index: gcc/config/s390/s390.c
===================================================================
*** gcc/config/s390/s390.c.orig
--- gcc/config/s390/s390.c
*************** s390_asm_trampoline_template (FILE *file
*** 9281,9296 ****
if (TARGET_64BIT)
{
! output_asm_insn ("basr\t%1,0", op);
! output_asm_insn ("lmg\t%0,%1,14(%1)", op);
! output_asm_insn ("br\t%1", op);
ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 10));
}
else
{
! output_asm_insn ("basr\t%1,0", op);
! output_asm_insn ("lm\t%0,%1,6(%1)", op);
! output_asm_insn ("br\t%1", op);
ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 8));
}
}
--- 9281,9296 ----
if (TARGET_64BIT)
{
! output_asm_insn ("basr\t%1,0", op); /* 2 byte */
! output_asm_insn ("lmg\t%0,%1,14(%1)", op); /* 6 byte */
! output_asm_insn ("br\t%1", op); /* 2 byte */
ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 10));
}
else
{
! output_asm_insn ("basr\t%1,0", op); /* 2 byte */
! output_asm_insn ("lm\t%0,%1,6(%1)", op); /* 4 byte */
! output_asm_insn ("br\t%1", op); /* 2 byte */
ASM_OUTPUT_SKIP (file, (HOST_WIDE_INT)(TRAMPOLINE_SIZE - 8));
}
}
*************** s390_trampoline_init (rtx m_tramp, tree
*** 9306,9316 ****
rtx mem;
emit_block_move (m_tramp, assemble_trampoline_template (),
! GEN_INT (2*UNITS_PER_WORD), BLOCK_OP_NORMAL);
! mem = adjust_address (m_tramp, Pmode, 2*UNITS_PER_WORD);
emit_move_insn (mem, cxt);
! mem = adjust_address (m_tramp, Pmode, 3*UNITS_PER_WORD);
emit_move_insn (mem, fnaddr);
}
--- 9306,9316 ----
rtx mem;
emit_block_move (m_tramp, assemble_trampoline_template (),
! GEN_INT (2 * UNITS_PER_LONG), BLOCK_OP_NORMAL);
! mem = adjust_address (m_tramp, Pmode, 2 * UNITS_PER_LONG);
emit_move_insn (mem, cxt);
! mem = adjust_address (m_tramp, Pmode, 3 * UNITS_PER_LONG);
emit_move_insn (mem, fnaddr);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-06 11:13 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-06 11:18 [Comitted] S/390: Fix static chain trampolines with -m31 -mzarch Andreas Krebbel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).