From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30540 invoked by alias); 6 May 2011 11:13:46 -0000 Received: (qmail 30531 invoked by uid 22791); 6 May 2011 11:13:45 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mtagate7.uk.ibm.com (HELO mtagate7.uk.ibm.com) (194.196.100.167) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 06 May 2011 11:13:31 +0000 Received: from d06nrmr1307.portsmouth.uk.ibm.com (d06nrmr1307.portsmouth.uk.ibm.com [9.149.38.129]) by mtagate7.uk.ibm.com (8.13.1/8.13.1) with ESMTP id p46BDUfj011278 for ; Fri, 6 May 2011 11:13:30 GMT Received: from d06av10.portsmouth.uk.ibm.com (d06av10.portsmouth.uk.ibm.com [9.149.37.251]) by d06nrmr1307.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p46BEhQV2150596 for ; Fri, 6 May 2011 12:14:43 +0100 Received: from d06av10.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p46BDTVb001118 for ; Fri, 6 May 2011 05:13:29 -0600 Received: from bart (dyn-9-152-224-47.boeblingen.de.ibm.com [9.152.224.47]) by d06av10.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVin) with SMTP id p46BDS8a001063 for ; Fri, 6 May 2011 05:13:28 -0600 Received: by bart (sSMTP sendmail emulation); Fri, 06 May 2011 13:13:28 +0200 From: "Andreas Krebbel" Date: Fri, 06 May 2011 11:18:00 -0000 To: gcc-patches@gcc.gnu.org Subject: [Comitted] S/390: Fix static chain trampolines with -m31 -mzarch Message-ID: <20110506111328.GA5425@bart> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-05/txt/msg00507.txt.bz2 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 * 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); }