This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[committed] PR target/25871: Fix MIPS trampolines for Pmode == DImode

I've applied Joshua Kinard's patch for PR 25871, in which the MIPS
nested function trampolines had 32-bit pointer moves even when
Pmode == DImode.

The bug isn't a regression, so I've not applied it to release branches.
However, the patch seems very safe to me, and should only affect people
for whom the current code doesn't work, so I'd be happy for it to be
applied to release branches too.

I can't test n64 myself right now, and mipsisa64-elf isn't much of a
test, because even though EABI64 has 64-bit pointers, a normal
mipsisa64-elf test will only use 32-bit pointer values.  I'll therefore
rely on the Gentoo testing that Joshua did and on the testing that
Joseph Myers has done on a CodeSourcery release branch.  I also tested
a mips-elf cross as a sanity check.  Applied to mainline.


2006-05-02  Joshua Kinard  <>

	PR target/25871
	* gcc/config/mips/mips.h (TRAMPOLINE_TEMPLATE): Avoid 32-bit moves
	with 64-bit pointers.

Index: gcc/config/mips/mips.h
--- gcc/config/mips/mips.h	(revision 113457)
+++ gcc/config/mips/mips.h	(working copy)
@@ -2023,31 +2023,36 @@ #define EXIT_IGNORE_STACK 1
    This code should not include a label--the label is taken care of
    automatically.  */
-{									 \
-  fprintf (STREAM, "\t.word\t0x03e00821\t\t# move   $1,$31\n");		\
+{									\
+  if (ptr_mode == DImode)						\
+    fprintf (STREAM, "\t.word\t0x03e0082d\t\t# dmove   $1,$31\n");	\
+  else									\
+    fprintf (STREAM, "\t.word\t0x03e00821\t\t# move   $1,$31\n");	\
   fprintf (STREAM, "\t.word\t0x04110001\t\t# bgezal $0,.+8\n");		\
   fprintf (STREAM, "\t.word\t0x00000000\t\t# nop\n");			\
   if (ptr_mode == DImode)						\
     {									\
       fprintf (STREAM, "\t.word\t0xdfe30014\t\t# ld     $3,20($31)\n");	\
       fprintf (STREAM, "\t.word\t0xdfe2001c\t\t# ld     $2,28($31)\n");	\
+      fprintf (STREAM, "\t.word\t0x0060c82d\t\t# dmove  $25,$3\n");	\
     }									\
   else									\
     {									\
       fprintf (STREAM, "\t.word\t0x8fe30014\t\t# lw     $3,20($31)\n");	\
       fprintf (STREAM, "\t.word\t0x8fe20018\t\t# lw     $2,24($31)\n");	\
+      fprintf (STREAM, "\t.word\t0x0060c821\t\t# move   $25,$3\n");	\
     }									\
-  fprintf (STREAM, "\t.word\t0x0060c821\t\t# move   $25,$3 (abicalls)\n"); \
   fprintf (STREAM, "\t.word\t0x00600008\t\t# jr     $3\n");		\
-  fprintf (STREAM, "\t.word\t0x0020f821\t\t# move   $31,$1\n");		\
   if (ptr_mode == DImode)						\
     {									\
+      fprintf (STREAM, "\t.word\t0x0020f82d\t\t# dmove   $31,$1\n");	\
       fprintf (STREAM, "\t.dword\t0x00000000\t\t# <function address>\n"); \
       fprintf (STREAM, "\t.dword\t0x00000000\t\t# <static chain value>\n"); \
     }									\
   else									\
     {									\
+      fprintf (STREAM, "\t.word\t0x0020f821\t\t# move   $31,$1\n");	\
       fprintf (STREAM, "\t.word\t0x00000000\t\t# <function address>\n"); \
       fprintf (STREAM, "\t.word\t0x00000000\t\t# <static chain value>\n"); \
     }									\

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]