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]

[RS6000] Correct cal operands


I noticed today that -mcpu=power2 -msecure-plt -fPIC hits assembly
errors.  The bug has been around since 2005-06-01 without being
discoverd, so I guess not too many people have old power boxes running
linux.  Bootstrapped powerpc-linux.  OK to install?

	* config/rs6000/rs6000.md (load_toc_v4_PIC_3c): Correct POWER
	form of instruction.

Index: gcc/config/rs6000/rs6000.md
===================================================================
--- gcc/config/rs6000/rs6000.md	(revision 152056)
+++ gcc/config/rs6000/rs6000.md	(working copy)
@@ -11513,7 +11513,7 @@ (define_insn "load_toc_v4_PIC_3c"
 		   (minus:SI (match_operand:SI 2 "symbol_ref_operand" "s")
 			     (match_operand:SI 3 "symbol_ref_operand" "s"))))]
   "TARGET_ELF && TARGET_SECURE_PLT && DEFAULT_ABI != ABI_AIX && flag_pic"
-  "{cal|addi} %0,%1,%2-%3@l")
+  "{cal %0,%2-%3@l(%1)|addi %0,%1,%2-%3@l}")
 
 ;; If the TOC is shared over a translation unit, as happens with all
 ;; the kinds of PIC that we support, we need to restore the TOC

-- 
Alan Modra
Australia Development Lab, IBM


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