Commit 71105114 by Alexandre Oliva Committed by Alexandre Oliva

sh.md (symPLT_label2reg): Force the initialization of the PIC register.

* config/sh/sh.md (symPLT_label2reg): Force the initialization of
the PIC register.

From-SVN: r36225
parent 3a0d3e1e
2000-09-07 Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.md (symPLT_label2reg): Force the initialization of
the PIC register.
2000-09-06 H.J. Lu (hjl@gnu.org)
* Makefile.in (clean_s1): Depend on stage_b.
......
......@@ -3531,8 +3531,24 @@ else
(plus:SI (pc)
(unspec [(match_operand:SI 1 "" "")] 9))
(const (plus:SI (label_ref (match_operand:SI 2 "" ""))
(const_int 2))))))]
"" "")
(const_int 2))))))
(use (match_dup 2))]
;; Even though the PIC register is not really used by the call
;; sequence in which this is expanded, the PLT code assumes the PIC
;; register is set, so we must not skip its initialization. Since
;; we only use this expand as part of calling sequences, and never
;; to take the address of a function, this is the best point to
;; insert the (use). Using the PLT to take the address of a
;; function would be wrong, not only because the PLT entry could
;; then be called from a function that doesn't initialize the PIC
;; register to the proper GOT, but also because pointers to the same
;; function might not compare equal, should they be set by different
;; shared libraries.
"" "
{
operands[2] = pic_offset_table_rtx;
current_function_uses_pic_offset_table = 1;
}")
;; case instruction for switch statements.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment