This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: SH PLT needs the PIC register to be set
- To: gcc-patches at gcc dot gnu dot org
- Subject: Re: SH PLT needs the PIC register to be set
- From: Alexandre Oliva <aoliva at redhat dot com>
- Date: 08 Sep 2000 07:59:59 -0300
- Organization: GCC Team, Red Hat
- References: <20000901191717.A27744@valinux.com><orn1hrecxf.fsf@guarana.lsd.ic.unicamp.br><20000901203837.A12389@valinux.com><orsnrjcuzj.fsf@guarana.lsd.ic.unicamp.br><orog27cu7u.fsf_-_@guarana.lsd.ic.unicamp.br>
On Sep 2, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
> On Sep 2, 2000, Alexandre Oliva <aoliva@redhat.com> wrote:
>> Which reminds me of the reason why I had initially set
>> current_function_uses_pic_offset_table to 1 in the `symPLT_label2reg'
>> define_expand in sh.md :-)
> Here's a patch that fixes this thinko. Ok to install?
And introduced another. operand2 was already in use :-(
I wonder how the patch passed my tests. I must have tested the wrong
tree :-(
I'm checking in this additional patch under the ``obviously correct''
rule. Sorry about that.
Index: gcc/ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* config/sh/sh.md (symPLT_label2reg): Use operand3 for PIC reg.
Index: gcc/config/sh/sh.md
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sh/sh.md,v
retrieving revision 1.45
diff -u -p -r1.45 sh.md
--- gcc/config/sh/sh.md 2000/09/08 02:51:45 1.45
+++ gcc/config/sh/sh.md 2000/09/08 10:54:55
@@ -3516,7 +3516,7 @@ else
(unspec [(match_operand:SI 1 "" "")] 9))
(const (plus:SI (label_ref (match_operand:SI 2 "" ""))
(const_int 2))))))
- (use (match_dup 2))]
+ (use (match_dup 3))]
;; 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
@@ -3530,7 +3530,7 @@ else
;; shared libraries.
"" "
{
- operands[2] = pic_offset_table_rtx;
+ operands[3] = pic_offset_table_rtx;
current_function_uses_pic_offset_table = 1;
}")
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me