diff options
Diffstat (limited to 'meta-oe/recipes-devtools/gcc/gcc-4.5/fedora/gcc43-ppc32-retaddr.patch')
-rw-r--r-- | meta-oe/recipes-devtools/gcc/gcc-4.5/fedora/gcc43-ppc32-retaddr.patch | 90 |
1 files changed, 90 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/gcc/gcc-4.5/fedora/gcc43-ppc32-retaddr.patch b/meta-oe/recipes-devtools/gcc/gcc-4.5/fedora/gcc43-ppc32-retaddr.patch new file mode 100644 index 0000000..3de4158 --- /dev/null +++ b/meta-oe/recipes-devtools/gcc/gcc-4.5/fedora/gcc43-ppc32-retaddr.patch @@ -0,0 +1,90 @@ +2005-11-28 Jakub Jelinek <jakub@redhat.com> + + * config/rs6000/rs6000.c (rs6000_return_addr): If COUNT == 0, + read word RETURN_ADDRESS_OFFSET bytes above arg_pointer_rtx + instead of doing an extran indirection from frame_pointer_rtx. + + * gcc.dg/20051128-1.c: New test. + +Index: gcc/config/rs6000/rs6000.c +=================================================================== +--- gcc/config/rs6000/rs6000.c.orig 2010-03-27 03:27:39.000000000 -0700 ++++ gcc/config/rs6000/rs6000.c 2010-06-25 10:18:04.053381930 -0700 +@@ -17646,17 +17646,22 @@ + don't try to be too clever here. */ + if (count != 0 || (DEFAULT_ABI != ABI_AIX && flag_pic)) + { ++ rtx x; + cfun->machine->ra_needs_full_frame = 1; + +- return +- gen_rtx_MEM +- (Pmode, +- memory_address +- (Pmode, +- plus_constant (copy_to_reg +- (gen_rtx_MEM (Pmode, +- memory_address (Pmode, frame))), +- RETURN_ADDRESS_OFFSET))); ++ if (count == 0) ++ { ++ gcc_assert (frame == frame_pointer_rtx); ++ x = arg_pointer_rtx; ++ } ++ else ++ { ++ x = memory_address (Pmode, frame); ++ x = copy_to_reg (gen_rtx_MEM (Pmode, x)); ++ } ++ ++ x = plus_constant (x, RETURN_ADDRESS_OFFSET); ++ return gen_rtx_MEM (Pmode, memory_address (Pmode, x)); + } + + cfun->machine->ra_need_lr = 1; +Index: gcc/testsuite/gcc.dg/20051128-1.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gcc/testsuite/gcc.dg/20051128-1.c 2010-06-25 10:18:04.061382856 -0700 +@@ -0,0 +1,41 @@ ++/* { dg-do run } */ ++/* { dg-options "-O2 -fpic" } */ ++ ++extern void exit (int); ++extern void abort (void); ++ ++int b; ++ ++struct A ++{ ++ void *pad[147]; ++ void *ra, *h; ++ long o; ++}; ++ ++void ++__attribute__((noinline)) ++foo (struct A *a, void *x) ++{ ++ __builtin_memset (a, 0, sizeof (a)); ++ if (!b) ++ exit (0); ++} ++ ++void ++__attribute__((noinline)) ++bar (void) ++{ ++ struct A a; ++ ++ __builtin_unwind_init (); ++ foo (&a, __builtin_return_address (0)); ++} ++ ++int ++main (void) ++{ ++ bar (); ++ abort (); ++ return 0; ++} |