This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, ARM]: Fix static interworking call
- From: Christian Bruel <christian dot bruel at st dot com>
- To: Richard Earnshaw <Richard dot Earnshaw at foss dot arm dot com>, "kyrylo dot tkachov at arm dot com" <kyrylo dot tkachov at arm dot com>, "Ramana dot Radhakrishnan at arm dot com" <Ramana dot Radhakrishnan at arm dot com>
- Cc: "gcc-patches at gcc dot gnu dot org" <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 21 Sep 2015 16:15:32 +0200
- Subject: Re: [PATCH, ARM]: Fix static interworking call
- Authentication-results: sourceware.org; auth=none
- References: <55FA7DD9 dot 8090108 at st dot com> <55FC1CD2 dot 10207 at foss dot arm dot com> <55FC21D0 dot 909 at st dot com> <55FC27C8 dot 7050503 at foss dot arm dot com>
On 09/18/2015 05:03 PM, Richard Earnshaw wrote:
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
The test was not crashing for -mfloat-abi=soft.
But the number of blx is independent. So yes we can write the conditions
in such a way the test runs without hard fp.
is this one better ?
/* Check that interwork between static functions is correctly resolved. */
/* { dg-require-effective-target arm_thumb2_ok } */
/* { dg-options "-O0 -march=armv7-a" } */
/* { 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 } } */