maybe fix opt/5863

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Thu Mar 21 15:16:00 GMT 2002


On Thursday 21 March 2002 19:17, Richard Henderson wrote:
> This doesn't avoid spilling the symbolic constant to memory, but does
> at least put it in .data instead of .rodata.  Franz, is this enough to
> get ld.so functional, or is something more invasive needed?

I didn't even get so far today:-((:

make[2]: Leaving directory `/cvsx/rawhide/BUILD/glibc-2.2.5/wcsmbs'
make[2]: Entering directory `/cvsx/rawhide/BUILD/glibc-2.2.5/wcsmbs'
btowc.c: In function `__btowc':
btowc.c:72: Internal compiler error in verify_local_live_at_start, at 
flow.c:583
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.gnu.org/software/gcc/bugs.html> for instructions.

I have to sleep now, I'll try to generate a small testcase tomorrow.

BTW, just for the records, find attached the patch I'm playing (!) with to 
fix the -fpic bug. It fixes the testcase in the testsuite, but causes a lot 
of additional failures, so probably I'm missing something fundamental.

Franz.

-------------- next part --------------
Index: rs6000.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.c,v
retrieving revision 1.279
diff -u -p -r1.279 rs6000.c
--- rs6000.c	2002/01/15 07:23:18	1.279
+++ rs6000.c	2002/02/03 12:14:08
@@ -2206,7 +2207,7 @@ rs6000_emit_move (dest, source, mode)
 	  && mode == Pmode && mode == SImode
 	  && flag_pic == 1 && got_operand (operands[1], mode))
 	{
-	  emit_insn (gen_movsi_got (operands[0], operands[1]));
+	  emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
 	  return;
 	}
 
Index: rs6000.md
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/rs6000/rs6000.md,v
retrieving revision 1.162
diff -u -p -r1.162 rs6000.md
--- rs6000.md	2002/01/29 22:49:55	1.162
+++ rs6000.md	2002/02/03 12:14:15
@@ -7514,52 +7551,34 @@
 
 ;; Set up a register with a value from the GOT table
 
-(define_expand "movsi_got"
-  [(set (match_operand:SI 0 "gpc_reg_operand" "")
-	(unspec:SI [(match_operand:SI 1 "got_operand" "")
-		    (match_dup 2)] UNSPEC_MOVSI_GOT))]
-  "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
-  "
-{
-  if (GET_CODE (operands[1]) == CONST)
-    {
-      rtx offset = const0_rtx;
-      HOST_WIDE_INT value;
-
-      operands[1] = eliminate_constant_term (XEXP (operands[1], 0), &offset);
-      value = INTVAL (offset);
-      if (value != 0)
-	{
-	  rtx tmp = (no_new_pseudos ? operands[0] : gen_reg_rtx (Pmode));
-	  emit_insn (gen_movsi_got (tmp, operands[1]));
-	  emit_insn (gen_addsi3 (operands[0], tmp, offset));
-	  DONE;
-	}
-    }
-
-  operands[2] = rs6000_got_register (operands[1]);
-}")
-
 (define_insn "*movsi_got_internal"
   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
 	(unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
-		    (match_operand:SI 2 "gpc_reg_operand" "b")] UNSPEC_MOVSI_GOT))]
+		    (match_operand:SI 2 "gpc_reg_operand" "b")]
+		   UNSPEC_MOVSI_GOT))]
   "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
   "{l|lwz} %0,%a1@got(%2)"
   [(set_attr "type" "load")])
 
+(define_insn "*movsi_got_internal2"
+  [(set (match_operand:SI 0 "gpc_reg_operand" "=b")
+	(match_operand:SI 1 "got_no_const_operand" ""))]
+  "DEFAULT_ABI == ABI_V4 && flag_pic == 1"
+  "#"
+  [(set_attr "type" "load")])
+
 ;; Used by sched, shorten_branches and final when the GOT pseudo reg
 ;; didn't get allocated to a hard register.
-(define_split 
+(define_split
   [(set (match_operand:SI 0 "gpc_reg_operand" "")
-	(unspec:SI [(match_operand:SI 1 "got_no_const_operand" "")
-		    (match_operand:SI 2 "memory_operand" "")] UNSPEC_MOVSI_GOT))]
+        (match_operand:SI 1 "got_no_const_operand" ""))]
   "DEFAULT_ABI == ABI_V4
     && flag_pic == 1
-    && (reload_in_progress || reload_completed)"
+    && reload_completed"
   [(set (match_dup 0) (match_dup 2))
-   (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)] UNSPEC_MOVSI_GOT))]
-  "")
+   (set (match_dup 0) (unspec:SI [(match_dup 1)(match_dup 0)]
+				 UNSPEC_MOVSI_GOT))]
+  "operands[2] = rs6000_got_register (operands[1]);")
 
 ;; For SI, we special-case integers that can't be loaded in one insn.  We
 ;; do the load 16-bits at a time.  We could do this by loading from memory,


More information about the Gcc-patches mailing list