This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[RS6000] Correct cal operands
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 24 Sep 2009 23:33:36 +0930
- Subject: [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