This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Comitted] S/390: Fix static chain trampolines with -m31 -mzarch
- From: "Andreas Krebbel" <krebbel at linux dot vnet dot ibm dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 6 May 2011 13:13:28 +0200
- Subject: [Comitted] S/390: Fix static chain trampolines with -m31 -mzarch
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);
}