From: Christian Bruel Date: Thu, 17 Sep 2015 15:57:59 +0000 (+0200) Subject: arm.md (*call_value_symbol): Fix operand for interworking. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1eb50e95fb660639b8cda502a69f2ee86d74d5e4;p=gcc.git arm.md (*call_value_symbol): Fix operand for interworking. 2015-09-17 Christian Bruel * config/arm/arm.md (*call_value_symbol): Fix operand for interworking. From-SVN: r227880 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1e9cf70182f..0faf86b4878 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2015-09-17 Christian Bruel + + * config/arm/arm.md (*call_value_symbol): Fix operand for interworking. + 2015-09-17 Richard Henderson PR libstdc++/65913 diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md index 1a8f32fa670..ad5b02e5589 100644 --- a/gcc/config/arm/arm.md +++ b/gcc/config/arm/arm.md @@ -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 --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0a3c7104539..86ba5b7e919 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2015-09-17 Christian Bruel + + * gcc.target/arm/attr_thumb-static2.c: New test. + 2015-09-17 Eric Botcazou * gnat.dg/overflow_sum3.adb: New test. diff --git a/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c b/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c new file mode 100644 index 00000000000..df8a6c0b46b --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/attr_thumb-static2.c @@ -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" } */ +/* { 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 } } */