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]

[PATCH] Fix -fPIC on sparc


Hi!

If reload wants to use a label_ref from some EQUIV_NOTE, we abort because of
trying to create new pseudos.
As the sequence is
sethi %hi(something), %tmp1
or %tmp1, %lo(something), %tmp2
sub %l7, %tmp2, %destreg

we can easily just use tmp1=tmp2=destreg in such situation.
This fixes -O2/-O3 crashes when building glibc on sparc64.

2000-01-21  Jakub Jelinek  <jakub@redhat.com>

	* config/sparc/sparc.md (movsi_pic_label_ref): Avoid creating new
	pseudos if expanded after first flow.
	(movdi_pic_label_ref): Likewise.

--- gcc/config/sparc/sparc.md.jj	Tue Jan 18 22:33:09 2000
+++ gcc/config/sparc/sparc.md	Fri Jan 21 12:07:35 2000
@@ -2273,8 +2273,13 @@
 {
   current_function_uses_pic_offset_table = 1;
   operands[2] = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
-  operands[3] = gen_reg_rtx (SImode);
-  operands[4] = gen_reg_rtx (SImode);
+  if (no_new_pseudos) {
+    operands[3] = operands[0];
+    operands[4] = operands[0];
+  } else {
+    operands[3] = gen_reg_rtx (SImode);
+    operands[4] = gen_reg_rtx (SImode);
+  }
   operands[5] = pic_offset_table_rtx;
 }")
 
@@ -2467,8 +2472,13 @@
 {
   current_function_uses_pic_offset_table = 1;
   operands[2] = gen_rtx_SYMBOL_REF (Pmode, \"_GLOBAL_OFFSET_TABLE_\");
-  operands[3] = gen_reg_rtx (DImode);
-  operands[4] = gen_reg_rtx (DImode);
+  if (no_new_pseudos) {
+    operands[3] = operands[0];
+    operands[4] = operands[0];
+  } else {
+    operands[3] = gen_reg_rtx (DImode);
+    operands[4] = gen_reg_rtx (DImode);
+  }
   operands[5] = pic_offset_table_rtx;
 }")
 


Cheers,
    Jakub
___________________________________________________________________
Jakub Jelinek | jakub@redhat.com | http://sunsite.mff.cuni.cz/~jj
Linux version 2.3.40 on a sparc64 machine (1343.49 BogoMips)
___________________________________________________________________

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