From patchwork Sun Feb 5 15:06:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 139649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 01616B7207 for ; Mon, 6 Feb 2012 02:07:06 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1329059234; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:From:To:Mail-Followup-To:Subject:Date:Message-ID: User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence: List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=IJOtKAQqm9w9qgsJSZBxNKSxsvs=; b=CAZr+u1I2upY8mb rMfe0f7IcfqLLD6vJtgEGTI+zAqtAtHNdGiEUevkaYl5Zz8Ae4lh4No004PVIUNa GzwPzz8/eoziv4AA3d10BmXmTpCUSWCuVerhGg2dkZKB4gu/0iyLDQiDo9t/PDPh ssoixcVOL2LGtaIsOtZI8uNkGxmM= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:From:To:Mail-Followup-To:Subject:Date:Message-ID:User-Agent:MIME-Version:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=kjawNq/Vl7Rc0pUdntszMNo/SLntBWngtLlnUvd7hPfd9KXipx+mMFUf15IJ66 Z2wtTuwWRA9fkdPLfEbH3Tbnd0TwJop/kYn8QrggRkxDcqZzn+tiyObXbroIMvVN 2ca8Xs9SHGrzmedssOL37aabaM5rWWXZN5beWKOIBLaZk=; Received: (qmail 29066 invoked by alias); 5 Feb 2012 15:07:02 -0000 Received: (qmail 29015 invoked by uid 22791); 5 Feb 2012 15:07:01 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wi0-f175.google.com (HELO mail-wi0-f175.google.com) (209.85.212.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Feb 2012 15:06:47 +0000 Received: by wibhq7 with SMTP id hq7so4432318wib.20 for ; Sun, 05 Feb 2012 07:06:45 -0800 (PST) Received: by 10.180.106.33 with SMTP id gr1mr22287621wib.6.1328454405682; Sun, 05 Feb 2012 07:06:45 -0800 (PST) Received: from localhost (rsandifo.gotadsl.co.uk. [82.133.89.107]) by mx.google.com with ESMTPS id l8sm37264885wiy.5.2012.02.05.07.06.44 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 07:06:45 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, rdsandiford@googlemail.com Subject: [MIPS, committed] Fix lengths of MIPS16 call patterns Date: Sun, 05 Feb 2012 15:06:44 +0000 Message-ID: <87ehu948vv.fsf@firetop.home> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org gcc.dg/fixed-point/convert.c and libgomp.fortran/vla3.f90 were failing on MIPS16 for mips64-linux-gnu with PLTs enabled because we were underestimating the length of a direct JAL. Tested on mips64-linux-gnu and various ELF targets. Applied. Richard gcc/ * config/mips/mips.md (sibcall_internal, sibcall_value_internal) (sibcall_value_multiple_internal, call_split, call_internal_direct) (call_direct_split, call_value_split, call_value_internal_direct) (call_value_direct_split, call_value_multiple_split): Use jal and jal_macro attributes. Index: gcc/config/mips/mips.md =================================================================== --- gcc/config/mips/mips.md 2012-02-04 20:15:02.000000000 +0000 +++ gcc/config/mips/mips.md 2012-02-04 20:17:58.000000000 +0000 @@ -6119,7 +6119,8 @@ (define_insn "sibcall_internal" (match_operand 1 "" ""))] "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" { return MIPS_CALL ("j", operands, 0, 1); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) (define_expand "sibcall_value" [(parallel [(set (match_operand 0 "") @@ -6139,7 +6140,8 @@ (define_insn "sibcall_value_internal" (match_operand 2 "" "")))] "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" { return MIPS_CALL ("j", operands, 1, 2); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) (define_insn "sibcall_value_multiple_internal" [(set (match_operand 0 "register_operand" "") @@ -6150,7 +6152,8 @@ (define_insn "sibcall_value_multiple_int (match_dup 2)))] "TARGET_SIBCALLS && SIBLING_CALL_P (insn)" { return MIPS_CALL ("j", operands, 1, 2); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) (define_expand "call" [(parallel [(call (match_operand 0 "") @@ -6214,13 +6217,14 @@ (define_insn_and_split "call_internal" [(set_attr "jal" "indirect,direct")]) (define_insn "call_split" - [(call (mem:SI (match_operand 0 "call_insn_operand" "cS")) + [(call (mem:SI (match_operand 0 "call_insn_operand" "c,S")) (match_operand 1 "" "")) (clobber (reg:SI RETURN_ADDR_REGNUM)) (clobber (reg:SI 28))] "TARGET_SPLIT_CALLS" { return MIPS_CALL ("jal", operands, 0, 1); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) ;; A pattern for calls that must be made directly. It is used for ;; MIPS16 calls that the linker may need to redirect to a hard-float @@ -6240,7 +6244,7 @@ (define_insn_and_split "call_internal_di gen_call_direct_split (operands[0], operands[1])); DONE; } - [(set_attr "type" "call")]) + [(set_attr "jal" "direct")]) (define_insn "call_direct_split" [(call (mem:SI (match_operand 0 "const_call_insn_operand")) @@ -6250,7 +6254,8 @@ (define_insn "call_direct_split" (clobber (reg:SI 28))] "TARGET_SPLIT_CALLS" { return MIPS_CALL ("jal", operands, 0, -1); } - [(set_attr "type" "call")]) + [(set_attr "jal" "direct") + (set_attr "jal_macro" "no")]) (define_expand "call_value" [(parallel [(set (match_operand 0 "") @@ -6284,13 +6289,14 @@ (define_insn_and_split "call_value_inter (define_insn "call_value_split" [(set (match_operand 0 "register_operand" "") - (call (mem:SI (match_operand 1 "call_insn_operand" "cS")) + (call (mem:SI (match_operand 1 "call_insn_operand" "c,S")) (match_operand 2 "" ""))) (clobber (reg:SI RETURN_ADDR_REGNUM)) (clobber (reg:SI 28))] "TARGET_SPLIT_CALLS" { return MIPS_CALL ("jal", operands, 1, 2); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) ;; See call_internal_direct. (define_insn_and_split "call_value_internal_direct" @@ -6309,7 +6315,7 @@ (define_insn_and_split "call_value_inter operands[2])); DONE; } - [(set_attr "type" "call")]) + [(set_attr "jal" "direct")]) (define_insn "call_value_direct_split" [(set (match_operand 0 "register_operand") @@ -6320,7 +6326,8 @@ (define_insn "call_value_direct_split" (clobber (reg:SI 28))] "TARGET_SPLIT_CALLS" { return MIPS_CALL ("jal", operands, 1, -1); } - [(set_attr "type" "call")]) + [(set_attr "jal" "direct") + (set_attr "jal_macro" "no")]) ;; See comment for call_internal. (define_insn_and_split "call_value_multiple_internal" @@ -6345,7 +6352,7 @@ (define_insn_and_split "call_value_multi (define_insn "call_value_multiple_split" [(set (match_operand 0 "register_operand" "") - (call (mem:SI (match_operand 1 "call_insn_operand" "cS")) + (call (mem:SI (match_operand 1 "call_insn_operand" "c,S")) (match_operand 2 "" ""))) (set (match_operand 3 "register_operand" "") (call (mem:SI (match_dup 1)) @@ -6354,7 +6361,8 @@ (define_insn "call_value_multiple_split" (clobber (reg:SI 28))] "TARGET_SPLIT_CALLS" { return MIPS_CALL ("jal", operands, 1, 2); } - [(set_attr "type" "call")]) + [(set_attr "jal" "indirect,direct") + (set_attr "jal_macro" "no")]) ;; Call subroutine returning any type.