diff options
author | Nick Clifton <nickc@redhat.com> | 2016-03-10 17:24:16 +0000 |
---|---|---|
committer | Nick Clifton <nickc@gcc.gnu.org> | 2016-03-10 17:24:16 +0000 |
commit | a3dc87600f8f874b1b684679b36a82d7da7d1653 (patch) | |
tree | 15b417256dc798c722215a7cbc5ae0f412221cf5 | |
parent | b87a8d7de708533d909b808a46d9fe52b7a07e52 (diff) | |
download | gcc-a3dc87600f8f874b1b684679b36a82d7da7d1653.zip gcc-a3dc87600f8f874b1b684679b36a82d7da7d1653.tar.gz gcc-a3dc87600f8f874b1b684679b36a82d7da7d1653.tar.bz2 |
re PR target/7044 (vax casesi breakage)
PR target/7044
* config/aarch64/aarch64.c
(aarch64_override_options_after_change_1): 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.
From-SVN: r234118
-rw-r--r-- | gcc/ChangeLog | 9 | ||||
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 17 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/aarch64/pr70044.c | 14 |
4 files changed, 44 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3486f06..d53c261 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2016-03-10 Nick Clifton <nickc@redhat.com> + + PR target/7044 + * config/aarch64/aarch64.c + (aarch64_override_options_after_change_1): 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-03-10 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * common/config/aarch64/aarch64-common.c (aarch64_handle_option): diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index 51dfe79..d536aa0 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -8110,10 +8110,25 @@ aarch64_parse_override_string (const char* input_string, static void aarch64_override_options_after_change_1 (struct gcc_options *opts) { + /* 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 (opts->x_flag_omit_frame_pointer == 2) + opts->x_flag_omit_frame_pointer = 0; + if (opts->x_flag_omit_frame_pointer) opts->x_flag_omit_leaf_frame_pointer = false; else if (opts->x_flag_omit_leaf_frame_pointer) - opts->x_flag_omit_frame_pointer = true; + opts->x_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 3043ab9..be04568 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-03-10 Nick Clifton <nickc@redhat.com> + + PR target/70044 + * gcc.target/aarch64/pr70044.c: New test. + 2016-03-10 Patrick Palka <ppalka@gcc.gnu.org> Jakub Jelinek <jakub@redhat.com> diff --git a/gcc/testsuite/gcc.target/aarch64/pr70044.c b/gcc/testsuite/gcc.target/aarch64/pr70044.c new file mode 100644 index 0000000..1a84941 --- /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," } } */ |