This is the mail archive of the gcc-patches@gcc.gnu.org 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]

[PATCH] Fix ppc64 out of line gpr/fpr saving with -mcall-aixdesc


On Fri, Sep 18, 2009 at 10:10:32AM +0930, Alan Modra wrote:
> On Fri, Sep 18, 2009 at 08:48:20AM +0930, Alan Modra wrote:
> > On Thu, Sep 17, 2009 at 10:03:14PM +0200, Jakub Jelinek wrote:
> > >         bl ._savegpr0_31
> > > ...
> > >         b ._restgpr0_31
> > > which fails to link, as the dots confuse the linker.
> > > My question is, should this be considered a linker bug, or should we change
> > > gcc to not emit any out of line gpr/fpr saving when TARGET_64BIT &&
> > > DOT_SYMBOLS, or should it emit bl _savegpr0_31 and b _restgpr0_31
> > > even in the dot sym world?
> > 
> > I would say it's a linker bug.  I'll fix it.
> 
> On looking at the PPC64 ABI again, I see that we have specified a symbol
> without a dot as far back as revision 1.0.  So you probably should change
> gcc to generate dot-less calls even when -mcall-aixdesc.  Apparently AIX
> expects them without a dot too.

The following patch should remove the dot addition then.  On AIX which
currently uses only the .savef* and .restf* routines it should make no
difference, as they already contain leading dot and %zN in that case doesn't
prepend anything even for DOT_SYMBOLS.

I guess the Linux ppc64 module-init-tools might need adjusting too, to also
create the out of line gpr/fpr saving/restoring routines on the fly as the
linker does.

2009-09-18  Jakub Jelinek  <jakub@redhat.com>

	* config/rs6000/rs6000.md (*save_gpregs_<mode>, *save_fpregs_<mode>,
	*restore_gpregs_<mode>, *return_and_restore_gpregs_<mode>,
	*return_and_restore_fpregs_<mode>,
	*return_and_restore_fpregs_aix_<mode>): Remove 'z' operand modifier.

--- gcc/config/rs6000/rs6000.md.jj	2009-09-16 14:46:19.000000000 +0200
+++ gcc/config/rs6000/rs6000.md	2009-09-18 08:25:23.000000000 +0200
@@ -15283,7 +15283,7 @@ (define_insn "*save_gpregs_<mode>"
 		    (set (match_operand:P 3 "memory_operand" "=m")
 			 (match_operand:P 4 "gpc_reg_operand" "r"))])]
   ""
-  "bl %z1"
+  "bl %1"
   [(set_attr "type" "branch")
    (set_attr "length" "4")])
 
@@ -15295,7 +15295,7 @@ (define_insn "*save_fpregs_<mode>"
 		    (set (match_operand:DF 3 "memory_operand" "=m")
 			 (match_operand:DF 4 "gpc_reg_operand" "f"))])]
   ""
-  "bl %z1"
+  "bl %1"
   [(set_attr "type" "branch")
    (set_attr "length" "4")])
 
@@ -15390,7 +15390,7 @@ (define_insn "*restore_gpregs_<mode>"
 		   (set (match_operand:P 4 "gpc_reg_operand" "=r")
 			(match_operand:P 5 "memory_operand" "m"))])]
  ""
- "bl %z2"
+ "bl %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
@@ -15403,7 +15403,7 @@ (define_insn "*return_and_restore_gpregs
 		   (set (match_operand:P 4 "gpc_reg_operand" "=r")
 			(match_operand:P 5 "memory_operand" "m"))])]
  ""
- "b %z2"
+ "b %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
@@ -15416,7 +15416,7 @@ (define_insn "*return_and_restore_fpregs
 		   (set (match_operand:DF 4 "gpc_reg_operand" "=f")
 			(match_operand:DF 5 "memory_operand" "m"))])]
  ""
- "b %z2"
+ "b %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 
@@ -15429,7 +15429,7 @@ (define_insn "*return_and_restore_fpregs
 		   (set (match_operand:DF 4 "gpc_reg_operand" "=d")
 			(match_operand:DF 5 "memory_operand" "m"))])]
  ""
- "b %z2"
+ "b %2"
  [(set_attr "type" "branch")
   (set_attr "length" "4")])
 


	Jakub


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