This is the mail archive of the 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]

Re: SH PLT needs the PIC register to be set

On Sep  2, 2000, Alexandre Oliva <> wrote:

> On Sep  2, 2000, Alexandre Oliva <> 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 :-)

> 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  <>

	* config/sh/ (symPLT_label2reg): Use operand3 for PIC reg.

Index: gcc/config/sh/
RCS file: /cvs/gcc/egcs/gcc/config/sh/,v
retrieving revision 1.45
diff -u -p -r1.45
--- gcc/config/sh/ 2000/09/08 02:51:45 1.45
+++ gcc/config/sh/ 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
Red Hat GCC Developer                  aoliva@{,}
CS PhD student at IC-Unicamp        oliva@{,}
Free Software Evangelist    *Please* write to mailing lists, not to me

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