From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31027 invoked by alias); 20 Sep 2015 23:55:36 -0000 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 Received: (qmail 31017 invoked by uid 89); 20 Sep 2015 23:55:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_50,KAM_STOCKGEN,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-qk0-f176.google.com Received: from mail-qk0-f176.google.com (HELO mail-qk0-f176.google.com) (209.85.220.176) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Sun, 20 Sep 2015 23:55:33 +0000 Received: by qkdw123 with SMTP id w123so39118315qkd.0 for ; Sun, 20 Sep 2015 16:55:30 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=UKYC6BYTcwD3U1RSk3sX7qdUlV8+3SrqTQV36DINa94=; b=JFqlw56ZEC8THojiCQKM1StW3k8IcGECuOZBpulvFRf62ODtNn7HPrL1nzrbje7eHa htQBx6Nzw9iwgAJT5lZTvGj+1A2JzelbZueDnmrzXA5ykEsu0R2k8fvw0AMswQLOYhix RRbDSmmTbHwgVrhv13QhHBiO0kqNy0pfkA0SnwDumg5VQQ0ajCs3yLXojrjB8S4RZI88 uJkPNpQR5smu8fevQpSH4SQx5RfLGh7fgG1HH4T5KMya3l61++Trrjahw+QRJRiiWZTZ kn4fPT4FqCG0Fcyp0U2+JOJbdYaghzMtOytzhN2N3iLDKunSB3Bf6M7DkXF4cMyPbLgo serg== X-Gm-Message-State: ALoCoQmqth/VByCHiFji7FC63xPnf3wKCImlDIbUAS5aZG3G/8ugeHAi++iFeoCv+ry6TSUjBzfS MIME-Version: 1.0 X-Received: by 10.55.23.9 with SMTP id i9mr19769575qkh.22.1442793330840; Sun, 20 Sep 2015 16:55:30 -0700 (PDT) Received: by 10.140.44.10 with HTTP; Sun, 20 Sep 2015 16:55:30 -0700 (PDT) In-Reply-To: <55FC27C8.7050503@foss.arm.com> References: <55FA7DD9.8090108@st.com> <55FC1CD2.10207@foss.arm.com> <55FC21D0.909@st.com> <55FC27C8.7050503@foss.arm.com> Date: Mon, 21 Sep 2015 00:22:00 -0000 Message-ID: Subject: Re: [PATCH, ARM]: Fix static interworking call From: Christophe Lyon To: Richard Earnshaw Cc: Christian Bruel , "kyrylo.tkachov@arm.com" , "Ramana.Radhakrishnan@arm.com" , "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg01509.txt.bz2 On 18 September 2015 at 17:03, Richard Earnshaw wrote: > On 18/09/15 15:38, Christian Bruel wrote: >> >> >> On 09/18/2015 04:16 PM, Richard Earnshaw wrote: >>> On 17/09/15 09:46, Christian Bruel wrote: >>>> As obvious, bad operand number. >>>> >>>> OK for trunk ? >>>> >>>> Christian >>>> >>>> >>>> p1.patch >>>> >>>> >>>> 2015-09-18 Christian Bruel >>>> >>>> * config/arm/arm.md (*call_value_symbol): Fix operand for >>>> interworking. >>>> >>>> 2015-09-18 Christian Bruel >>>> >>>> * gcc.target/arm/attr_thumb-static2.c: New test. >>>> >>>> --- gnu_trunk.ref/gcc/gcc/config/arm/arm.md 2015-09-14 >>>> 09:52:37.697264500 +0200 >>>> +++ gnu_trunk.p0/gcc/gcc/config/arm/arm.md 2015-09-17 >>>> 10:03:33.849451705 +0200 >>>> @@ -7891,7 +7891,7 @@ >>>> /* Switch mode now when possible. */ >>>> if (SYMBOL_REF_DECL (op) && !TREE_PUBLIC (SYMBOL_REF_DECL (op)) >>>> && arm_arch5 && arm_change_mode_p (SYMBOL_REF_DECL (op))) >>>> - return NEED_PLT_RELOC ? \"blx%?\\t%a0(PLT)\" : \"blx%?\\t(%a0)\"; >>>> + return NEED_PLT_RELOC ? \"blx%?\\t%a1(PLT)\" : \"blx%?\\t(%a1)\"; >>>> >>>> return NEED_PLT_RELOC ? \"bl%?\\t%a1(PLT)\" : \"bl%?\\t%a1\"; >>>> }" >>>> diff -ruNp >>>> gnu_trunk.ref/gcc/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c >>>> gnu_trunk.p0/gcc/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c >>>> --- >>>> gnu_trunk.ref/gcc/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c 1970-01-01 >>>> 01:00:00.000000000 +0100 >>>> +++ >>>> gnu_trunk.p0/gcc/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c >>>> 2015-09-17 10:08:08.350064131 +0200 >>>> @@ -0,0 +1,40 @@ >>>> +/* Check that interwork between static functions is correctly >>>> resolved. */ >>>> + >>>> +/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */ >>>> +/* { dg-options "-O0 -march=armv7-a -mfloat-abi=hard" } */ >>> >>> You can't have thumb1 and hard float, >> >> Ah OK I didn't know that. Is it that there was no FPU before V5 ? >> > > Thumb1 had no instruction encodings for accessing the FPU. > >>> so the skip unless thumb1 seems a nonsense. >> >> And there is no thumb1 and march=armv7-a !. So indeed the skip unless >> thumb1 is a nonsense. >> Is the attached patch OK to clean this up ? >> >> thanks, >> >> >>> >>> R. >>> >>>> +/* { dg-do compile } */ >>>> + >>>> +struct _NSPoint >>>> +{ >>>> + float x; >>>> + float y; >>>> +}; >>>> + >>>> +typedef struct _NSPoint NSPoint; >>>> + >>>> +static NSPoint >>>> +__attribute__ ((target("arm"))) >>>> +NSMakePoint (float x, float y) >>>> +{ >>>> + NSPoint point; >>>> + point.x = x; >>>> + point.y = y; >>>> + return point; >>>> +} >>>> + >>>> +static NSPoint >>>> +__attribute__ ((target("thumb"))) >>>> +RelativePoint (NSPoint point, NSPoint refPoint) >>>> +{ >>>> + return NSMakePoint (refPoint.x + point.x, refPoint.y + point.y); >>>> +} >>>> + >>>> +NSPoint >>>> +__attribute__ ((target("arm"))) >>>> +g(NSPoint refPoint) >>>> +{ >>>> + float pointA, pointB; >>>> + return RelativePoint (NSMakePoint (0, pointA), refPoint); >>>> +} >>>> + >>>> +/* { dg-final { scan-assembler-times "blx" 2 } } */ >>>> >>> >> >> 1.patch >> >> >> 2015-09-17 Christian Bruel >> >> * gcc.target/arm/attr_thumb-static2.c: Test only for thumb2. >> >> Index: attr_thumb-static2.c >> =================================================================== >> --- attr_thumb-static2.c (revision 227904) >> +++ attr_thumb-static2.c (working copy) >> @@ -1,6 +1,6 @@ >> /* Check that interwork between static functions is correctly resolved. */ >> >> -/* { dg-skip-if "" { ! { arm_thumb1_ok || arm_thumb2_ok } } } */ >> +/* { dg-require-effective-target arm_thumb2_ok } */ >> /* { dg-options "-O0 -march=armv7-a -mfloat-abi=hard" } */ >> /* { dg-do compile } */ >> >> > > Do you really need -mfloat-abi=hard for this test? If so, I think you > also need "dg-require-effective-target arm_hard_vfp_ok". See > gcc.target/arm/pr65729.c > > R. > Christian, It seems you committed the 1st version of your patch. However, it fails if one forces a armv5t target, because, as Richard said -mfloat-abi=hard is not supported on Thumb1. It tried to remove -mfloat-abi=hard, and I noticed that only 1 'blx' is generated when using soft or softfp. I expect this to be fixed by the linker anyway, but it may mean there is still something wrong. Christophe.