summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-14 13:45:34 +0000
committerktkachov <ktkachov@138bc75d-0d04-0410-961f-82ee72b054a4>2016-04-14 13:45:34 +0000
commit0122d758dc4364ca62f927f26c3266077d22a30e (patch)
tree82b335cd74d49fd5b7aa324fb6b35af44e2201df
parente99fb78539fa618083f867a29b3bba829da9f6cc (diff)
downloadlinaro-gcc-0122d758dc4364ca62f927f26c3266077d22a30e.tar.gz
linaro-gcc-0122d758dc4364ca62f927f26c3266077d22a30e.tar.bz2
linaro-gcc-0122d758dc4364ca62f927f26c3266077d22a30e.zip
[AArch64] Backport of PR target/70044 fix to GCC 5
2016-04-14 Nick Clifton <nickc@redhat.com> Kyrylo Tkachov <kyrylo.tkachov@arm.com> PR target/70044 * config/aarch64/aarch64.c (aarch64_override_options_after_change): When forcing flag_omit_frame_pointer to be true, use a special value that can be detected if this function is called again, thus preventing flag_omit_leaf_frame_pointer from being forced to be false. * gcc.target/aarch64/pr70044.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-5-branch@234974 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog10
-rw-r--r--gcc/config/aarch64/aarch64.c18
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/gcc.target/aarch64/pr70044.c14
4 files changed, 49 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 275be460544..f6cb067a3d8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2016-04-14 Nick Clifton <nickc@redhat.com>
+ Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR target/70044
+ * config/aarch64/aarch64.c
+ (aarch64_override_options_after_change): When forcing
+ flag_omit_frame_pointer to be true, use a special value that can
+ be detected if this function is called again, thus preventing
+ flag_omit_leaf_frame_pointer from being forced to be false.
+
2016-04-12 Eric Botcazou <ebotcazou@adacore.com>
PR target/70630
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c
index 5c7291e535d..4113609d470 100644
--- a/gcc/config/aarch64/aarch64.c
+++ b/gcc/config/aarch64/aarch64.c
@@ -6917,10 +6917,26 @@ aarch64_override_options (void)
static void
aarch64_override_options_after_change (void)
{
+ /* The logic here is that if we are disabling all frame pointer generation
+ then we do not need to disable leaf frame pointer generation as a
+ separate operation. But if we are *only* disabling leaf frame pointer
+ generation then we set flag_omit_frame_pointer to true, but in
+ aarch64_frame_pointer_required we return false only for leaf functions.
+
+ PR 70044: We have to be careful about being called multiple times for the
+ same function. Once we have decided to set flag_omit_frame_pointer just
+ so that we can omit leaf frame pointers, we must then not interpret a
+ second call as meaning that all frame pointer generation should be
+ omitted. We do this by setting flag_omit_frame_pointer to a special,
+ non-zero value. */
+
+ if (flag_omit_frame_pointer == 2)
+ flag_omit_frame_pointer = 0;
+
if (flag_omit_frame_pointer)
flag_omit_leaf_frame_pointer = false;
else if (flag_omit_leaf_frame_pointer)
- flag_omit_frame_pointer = true;
+ flag_omit_frame_pointer = 2;
/* If not optimizing for size, set the default
alignment to what the target wants */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 74ca8a6b91c..12bda055379 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2016-04-14 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ Backport from mainline
+ 2016-03-31 Nick Clifton <nickc@redhat.com>
+
+ PR target/70044
+ * gcc.target/aarch64/pr70044.c: New test.
+
2016-04-13 Alan Modra <amodra@gmail.com>
Backport from mainline
diff --git a/gcc/testsuite/gcc.target/aarch64/pr70044.c b/gcc/testsuite/gcc.target/aarch64/pr70044.c
new file mode 100644
index 00000000000..1a84941dd7e
--- /dev/null
+++ b/gcc/testsuite/gcc.target/aarch64/pr70044.c
@@ -0,0 +1,14 @@
+/* { dg-do link } */
+/* { dg-require-effective-target lto } */
+/* { dg-options "-flto -O --save-temps -fno-omit-frame-pointer" } */
+
+extern int atoi (const char *);
+
+int
+main (int argc, char **argv)
+{
+ return atoi (argv[0]) + 1;
+}
+
+/* Check that the frame pointer really is created. */
+/* { dg-final { scan-lto-assembler "add x29, sp," } } */