This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, ARM]: Fix static interworking call




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 } } */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]