aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2014-01-04 21:51:51 +0000
committerEric Botcazou <ebotcazou@gcc.gnu.org>2014-01-04 21:51:51 +0000
commitf2bc252be3a5ccb8846fdc28a830b8a75cf64519 (patch)
treee739bab6b27734e81f94f43d982d889228873821
parent39719c84006d2dc2873cef482de74755925e631f (diff)
downloadgcc-f2bc252be3a5ccb8846fdc28a830b8a75cf64519.zip
gcc-f2bc252be3a5ccb8846fdc28a830b8a75cf64519.tar.gz
gcc-f2bc252be3a5ccb8846fdc28a830b8a75cf64519.tar.bz2
arm.c (arm_get_frame_offsets): Revamp long lines.
* config/arm/arm.c (arm_get_frame_offsets): Revamp long lines. (arm_expand_epilogue_apcs_frame): Take into account the number of bytes used to save the static chain register in the computation of the offset from which the FP registers need to be restored. From-SVN: r206337
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/arm/arm.c16
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/arm/neon-nested-apcs.c47
4 files changed, 69 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 9ce3973..83b39e2 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2014-01-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * config/arm/arm.c (arm_get_frame_offsets): Revamp long lines.
+ (arm_expand_epilogue_apcs_frame): Take into account the number of bytes
+ used to save the static chain register in the computation of the offset
+ from which the FP registers need to be restored.
+
2014-01-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59519
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index e82e069..142db45 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -20316,8 +20316,10 @@ arm_get_frame_offsets (void)
offsets->saved_args = crtl->args.pretend_args_size;
/* In Thumb mode this is incorrect, but never used. */
- offsets->frame = offsets->saved_args + (frame_pointer_needed ? 4 : 0) +
- arm_compute_static_chain_stack_bytes();
+ offsets->frame
+ = (offsets->saved_args
+ + arm_compute_static_chain_stack_bytes ()
+ + (frame_pointer_needed ? 4 : 0));
if (TARGET_32BIT)
{
@@ -20357,9 +20359,10 @@ arm_get_frame_offsets (void)
}
/* Saved registers include the stack frame. */
- offsets->saved_regs = offsets->saved_args + saved +
- arm_compute_static_chain_stack_bytes();
+ offsets->saved_regs
+ = offsets->saved_args + arm_compute_static_chain_stack_bytes () + saved;
offsets->soft_frame = offsets->saved_regs + CALLER_INTERWORKING_SLOT_SIZE;
+
/* A leaf function does not need any stack alignment if it has nothing
on the stack. */
if (leaf && frame_size == 0
@@ -27048,7 +27051,10 @@ arm_expand_epilogue_apcs_frame (bool really_return)
saved_regs_mask = offsets->saved_regs_mask;
/* Find the offset of the floating-point save area in the frame. */
- floats_from_frame = offsets->saved_args - offsets->frame;
+ floats_from_frame
+ = (offsets->saved_args
+ + arm_compute_static_chain_stack_bytes ()
+ - offsets->frame);
/* Compute how many core registers saved and how far away the floats are. */
for (i = 0; i <= LAST_ARM_REGNUM; i++)
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 395607a..f6dbf1f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,7 @@
+2014-01-04 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc.target/arm/neon-nested-apcs.c: New test.
+
2014-01-04 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/59519
diff --git a/gcc/testsuite/gcc.target/arm/neon-nested-apcs.c b/gcc/testsuite/gcc.target/arm/neon-nested-apcs.c
new file mode 100644
index 0000000..a2cf642
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/neon-nested-apcs.c
@@ -0,0 +1,47 @@
+/* { dg-do run } */
+/* { dg-require-effective-target arm_neon_hw } */
+/* { dg-options "-fno-omit-frame-pointer -mapcs-frame -O -mfloat-abi=softfp -mfpu=neon" } */
+
+extern void abort (void);
+
+float data;
+
+void __attribute__((noinline, noclone)) bar (float f)
+{
+ data = f;
+}
+
+float __attribute__((noinline, noclone)) foo (float f)
+{
+ int error_reported = 0;
+
+ void __attribute__((noinline, noclone))
+ nested (int a, int b, int c, int d, float f0, float f1, float f2, float f3)
+ {
+ float e;
+
+ if (f3 > f2)
+ e = f3;
+ else
+ e = f2;
+
+ if (f0 - f1 > e)
+ {
+ error_reported = a + b + c + d;
+ bar (f0);
+ bar (e);
+ }
+ }
+
+ nested (1, 2, 3, 4, 1.0, 1.0, 3.5, 4.2);
+ return f + (float)error_reported;
+}
+
+#define PI 3.1415927f
+
+int main (void)
+{
+ if (foo (PI) != PI)
+ abort ();
+ return 0;
+}