diff options
author | Radovan Obradovic <radovan.obradovic@imgtec.com> | 2015-01-05 23:42:27 +0000 |
---|---|---|
committer | Catherine Moore <clm@gcc.gnu.org> | 2015-01-05 18:42:27 -0500 |
commit | b176bb73b4496d12966ed68023fc313041f7f3b8 (patch) | |
tree | b7637466efcbde73b997cf9690452ac98702468f /gcc | |
parent | dd1ca4c209746c0d8d30bd472bb55bc115d967f2 (diff) | |
download | gcc-b176bb73b4496d12966ed68023fc313041f7f3b8.zip gcc-b176bb73b4496d12966ed68023fc313041f7f3b8.tar.gz gcc-b176bb73b4496d12966ed68023fc313041f7f3b8.tar.bz2 |
re PR rtl-optimization/64287 (Disable -fuse-caller-save when -pg is active)
2015-01-05 Radovan Obradovic <radovan.obradovic@imgtec.com>
PR rtl-optimization/64287
gcc/
* toplev.c (HAVE_epilogue, HAVE_prologue): Provide default.
(process_options): Disable flag_ipa_ra if profiling.
gcc/testsuite/
* gcc.dg/aru-2.c: New test.
From-SVN: r219208
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/aru-2.c | 26 | ||||
-rw-r--r-- | gcc/toplev.c | 12 |
4 files changed, 49 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 24bcddf..a50e56a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2015-01-05 Radovan Obradovic <radovan.obradovic@imgtec.com> + + PR rtl-optimization/64287 + * toplev.c (HAVE_epilogue, HAVE_prologue): Provide default. + (process_options): Disable flag_ipa_ra if profiling. + 2015-01-05 Eric Botcazou <ebotcazou@adacore.com> * config/nds32/nds32-peephole2.md: Do not mention define_peephole. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 8633d7e..cac2f79 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-05 Radovan Obradovic <radovan.obradovic@imgtec.com> + + PR rtl-optimization/64287 + * gcc.dg/aru-2.c: New test. + 2015-01-05 Jakub Jelinek <jakub@redhat.com> PR sanitizer/64344 diff --git a/gcc/testsuite/gcc.dg/aru-2.c b/gcc/testsuite/gcc.dg/aru-2.c new file mode 100644 index 0000000..efd1f01 --- /dev/null +++ b/gcc/testsuite/gcc.dg/aru-2.c @@ -0,0 +1,26 @@ +/* { dg-do run } */ +/* { dg-options "-O2 -pg" } */ + +static int __attribute__((noinline)) +bar (int x) +{ + return x + 3; +} + +int __attribute__((noinline)) +foo (int y0, int y1, int y2, int y3, int y4) { + int r = 0; + r += bar (r + y4); + r += bar (r + y3); + r += bar (r + y2); + r += bar (r + y1); + r += bar (r + y0); + return r; +} + +int +main (void) +{ + int z = foo (0, 1, 2, 3, 4); + return !(z == 191); +} diff --git a/gcc/toplev.c b/gcc/toplev.c index 08050e7..1ad76f2 100644 --- a/gcc/toplev.c +++ b/gcc/toplev.c @@ -113,6 +113,13 @@ along with GCC; see the file COPYING3. If not see declarations for e.g. AIX 4.x. */ #endif +#ifndef HAVE_epilogue +#define HAVE_epilogue 0 +#endif +#ifndef HAVE_prologue +#define HAVE_prologue 0 +#endif + #include <new> static void general_init (const char *); @@ -1634,6 +1641,11 @@ process_options (void) /* Save the current optimization options. */ optimization_default_node = build_optimization_node (&global_options); optimization_current_node = optimization_default_node; + + /* Disable use caller save optimization if profiler is active or port + does not emit prologue and epilogue as RTL. */ + if (profile_flag || !HAVE_prologue || !HAVE_epilogue) + flag_ipa_ra = 0; } /* This function can be called multiple times to reinitialize the compiler |