public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Andreas Krebbel" <krebbel@linux.vnet.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [Comitted] S/390: Fix static chain trampolines with -m31 -mzarch
Date: Fri, 06 May 2011 11:18:00 -0000	[thread overview]
Message-ID: <20110506111328.GA5425@bart> (raw)

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);
  }
  

                 reply	other threads:[~2011-05-06 11:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110506111328.GA5425@bart \
    --to=krebbel@linux.vnet.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).