From patchwork Thu Feb 7 08:08:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 218864 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 6F5E02C0291 for ; Thu, 7 Feb 2013 19:08:41 +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=1360829322; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:Reply-To: MIME-Version:Content-Type:Content-Disposition:User-Agent: Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:Sender:Delivered-To; bh=NL0PHqcC+TTfTvD8EmeS dmLJwIk=; b=BEumcNHGJJSb2jly5miCsJ2RfE6ZMm7zgb+o4Ssqkf7Bbc25S/up RXOnNf2PNrjmWOTAFOGGPkWPJ5QgX2Z25wDEGLPCYFxPtwspNqT8gA4qoMMmvLWp tOOdOmZ1EJR5t3GREmEKbf6JT+32J4uE9ocknMC6D7BGJisyvhZItac= 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:Received:Date:From:To:Subject:Message-ID:Reply-To:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=C6ZWNSvmj48bKtBI0eAjZabdM8JDihAKzzlvEdl0EMkXSNUhpVZYu0eSdGafy5 NMWr1O4FvkLec70CpxUmIGbRChPdXvS27nF6tKjwruSeHZ4yuvlSNCyKEuKnzLm1 Zn8uR2GL+OCPTQJYX6iFKmbY17Ubq1mzTPuH0KGXZI+2o=; Received: (qmail 19940 invoked by alias); 7 Feb 2013 08:08:24 -0000 Received: (qmail 19927 invoked by uid 22791); 7 Feb 2013 08:08:23 -0000 X-SWARE-Spam-Status: No, hits=-6.2 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, KHOP_SPAMHAUS_DROP, RCVD_IN_DNSWL_HI, RCVD_IN_HOSTKARMA_W, RP_MATCHES_RCVD, SPF_HELO_PASS, TW_FN X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Feb 2013 08:08:11 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r1788B8v025217 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 7 Feb 2013 03:08:11 -0500 Received: from zalov.redhat.com (vpn1-6-46.ams2.redhat.com [10.36.6.46]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r17889e1003868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 7 Feb 2013 03:08:11 -0500 Received: from zalov.cz (localhost [127.0.0.1]) by zalov.redhat.com (8.14.5/8.14.5) with ESMTP id r178890h024809 for ; Thu, 7 Feb 2013 09:08:09 +0100 Received: (from jakub@localhost) by zalov.cz (8.14.5/8.14.5/Submit) id r17888TW024808 for gcc-patches@gcc.gnu.org; Thu, 7 Feb 2013 09:08:08 +0100 Date: Thu, 7 Feb 2013 09:08:07 +0100 From: Jakub Jelinek To: gcc-patches@gcc.gnu.org Subject: [committed] Fix up ppc64 call pattern constraints (PR target/56228) Message-ID: <20130207080807.GX4385@tucnak.redhat.com> Reply-To: Jakub Jelinek MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Hi! As described in the PR, when the ppc64 indirect aix call patterns use ld insn, we need to use "Y" constraint for the memory operand instead of "m", otherwise the offset might not be multiple of 4. Fixed thusly, approved by David in the PR, bootstrapped/regtested on powerpc-linux and powerpc64-linux, committed to trunk. 2013-02-07 Jakub Jelinek PR target/56228 * config/rs6000/rs6000.md (ptrm): New mode attr. (call_indirect_aix, call_indirect_aix_nor11, call_value_indirect_aix, call_value_indirect_aix_nor11): Use instead of m in constraints. * gcc.dg/pr56228.c: New test. Jakub --- gcc/config/rs6000/rs6000.md.jj 2013-02-01 17:52:37.000000000 +0100 +++ gcc/config/rs6000/rs6000.md 2013-02-06 17:27:07.680250027 +0100 @@ -292,6 +292,9 @@ (define_mode_attr mptrsize [(SI "si") (define_mode_attr ptrload [(SI "lwz") (DI "ld")]) +(define_mode_attr ptrm [(SI "m") + (DI "Y")]) + (define_mode_attr rreg [(SF "f") (DF "ws") (V4SF "wf") @@ -10662,8 +10665,8 @@ (define_insn "*call_value_local64" (define_insn "call_indirect_aix" [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l")) (match_operand 1 "" "g,g")) - (use (match_operand:P 2 "memory_operand" "m,m")) - (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m")) + (use (match_operand:P 2 "memory_operand" ",")) + (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" ",")) (use (reg:P STATIC_CHAIN_REGNUM)) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS" @@ -10680,8 +10683,8 @@ (define_insn "call_indirect_aix (define_insn "call_indirect_aix_nor11" [(call (mem:SI (match_operand:P 0 "register_operand" "c,*l")) (match_operand 1 "" "g,g")) - (use (match_operand:P 2 "memory_operand" "m,m")) - (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" "m,m")) + (use (match_operand:P 2 "memory_operand" ",")) + (set (reg:P TOC_REGNUM) (match_operand:P 3 "memory_operand" ",")) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS" " 2,%2\;b%T0l\; 2,%3" @@ -10698,8 +10701,8 @@ (define_insn "call_value_indirect_aix,")) + (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" ",")) (use (reg:P STATIC_CHAIN_REGNUM)) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX && TARGET_POINTERS_TO_NESTED_FUNCTIONS" @@ -10718,8 +10721,8 @@ (define_insn "call_value_indirect_aix,")) + (set (reg:P TOC_REGNUM) (match_operand:P 4 "memory_operand" ",")) (clobber (reg:P LR_REGNO))] "DEFAULT_ABI == ABI_AIX && !TARGET_POINTERS_TO_NESTED_FUNCTIONS" " 2,%3\;b%T1l\; 2,%4" --- gcc/testsuite/gcc.dg/pr56228.c.jj 2013-02-06 17:44:33.409303617 +0100 +++ gcc/testsuite/gcc.dg/pr56228.c 2013-02-06 17:44:14.000000000 +0100 @@ -0,0 +1,16 @@ +/* PR target/56228 */ +/* { dg-do assemble } */ +/* { dg-options "-O2" } */ + +short a[14] = { 1, 2 }; +short b[15] = { 3, 4 }; + +int +foo () +{ + void (*fna) (void) = (void (*) (void)) a; + void (*fnb) (void) = (void (*) (void)) b; + fna (); + fnb (); + return a[1] == b[1]; +}