This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
fix for -fpic on powerpc
- To: gcc-patches at gcc dot gnu dot org
- Subject: fix for -fpic on powerpc
- From: Geoff Keating <geoffk at geoffk dot org>
- Date: Sun, 6 May 2001 19:53:06 -0700
- Reply-to: Geoff Keating <geoffk at redhat dot com>
This makes the -fpic testsuite on powerpc-linux have the same failure
set as the plain testsuite.
Tested on powerpc-linux (by running testsuite both with and without -fpic).
--
- Geoffrey Keating <geoffk@geoffk.org>
===File ~/patches/cygnus/rs6000-nosavelrnoreturn.patch======
2001-05-06 Geoff Keating <geoffk@redhat.com>
* config/rs6000/rs6000.c (rs6000_emit_prologue): Don't save
the link register if we're not going to use it.
* config/rs6000/rs6000.c (output_profile_hook): Fix a warning.
(output_function_profiler): Likewise.
Index: gcc/config/rs6000/rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.177
diff -p -u -u -p -r1.177 rs6000.c
--- rs6000.c 2001/05/02 20:30:17 1.177
+++ rs6000.c 2001/05/07 02:48:24
@@ -37,6 +37,7 @@ Boston, MA 02111-1307, USA. */
#include "except.h"
#include "function.h"
#include "output.h"
+#include "basic-block.h"
#include "toplev.h"
#include "ggc.h"
#include "hashtab.h"
@@ -5940,8 +5941,9 @@ rs6000_emit_prologue ()
it. We use R11 for this purpose because emit_load_toc_table
can use register 0. This allows us to use a plain 'blr' to return
from the procedure more often. */
- int save_LR_around_toc_setup = (TARGET_ELF && flag_pic != 0 &&
- ! info->lr_save_p);
+ int save_LR_around_toc_setup = (TARGET_ELF && flag_pic != 0
+ && ! info->lr_save_p
+ && EXIT_BLOCK_PTR->pred != NULL);
if (save_LR_around_toc_setup)
emit_move_insn (gen_rtx_REG (Pmode, 11),
gen_rtx_REG (Pmode, LINK_REGISTER_REGNUM));
@@ -7347,7 +7349,7 @@ output_profile_hook (labelno)
}
else if (DEFAULT_ABI == ABI_DARWIN)
{
- char *mcount_name = RS6000_MCOUNT;
+ const char *mcount_name = RS6000_MCOUNT;
int caller_addr_regno = LINK_REGISTER_REGNUM;
/* Be conservative and always set this, at least for now. */
@@ -7376,9 +7378,6 @@ output_function_profiler (file, labelno)
FILE *file;
int labelno;
{
- /* The last used parameter register. */
- int last_parm_reg;
- int i, j;
char buf[100];
ASM_GENERATE_INTERNAL_LABEL (buf, "LP", labelno);
============================================================