Bootstrap failure on powerpc-ibm-aix4.1.4.0 building libF77/r_sign.c

Kaveh R. Ghazi ghazi@caip.rutgers.edu
Sat Jul 8 05:13:00 GMT 2000


 > From: Geoff Keating <geoffk@cygnus.com>
 > 
 > This is probably my fault.  Could you try replacing the
 > double-precision-truncating block in rs6000_emit_move with:
 > 
 >   if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT
 >       && GET_CODE (operands[0]) == MEM)
 >     {
 >       int regnum;
 > 
 >       if (reload_in_progress || reload_completed)
 > 	regnum = true_regnum (operands[1]);
 >       else if (GET_CODE (operands[1]) == REG)
 > 	regnum = REGNO (operands[1]);
 >       else
 > 	regnum = -1;
 >       
 >       /* If operands[1] is a register, on POWER it may have
 > 	 double-precision data in it, so truncate it to single
 > 	 precision.  */
 >       if (FP_REGNO_P (regnum) || regnum >= FIRST_PSEUDO_REGISTER)
 > 	{
 > 	  rtx newreg;
 > 	  newreg = (no_new_pseudos ? operands[1] : gen_reg_rtx (mode));
 > 	  emit_insn (gen_aux_truncdfsf2 (newreg, operands[1]));
 > 	  operands[1] = newreg;
 > 	}
 >     }
 > 
 > and see if that helps?
 > 
 > -- 
 > - Geoffrey Keating <geoffk@cygnus.com>



Okay to be precise, I derived and installed the following patch in my tree:

--- egcs-CVS20000707/gcc/config/rs6000/rs6000.c~	Tue Jul  4 06:53:45 2000
+++ egcs-CVS20000707/gcc/config/rs6000/rs6000.c	Fri Jul  7 22:14:48 2000
@@ -1492,10 +1492,17 @@ rs6000_emit_move (dest, source, mode)
   if (! no_new_pseudos && GET_CODE (operands[0]) != REG)
     operands[1] = force_reg (mode, operands[1]);
   
-  if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT)
+  if (mode == SFmode && ! TARGET_POWERPC && TARGET_HARD_FLOAT
+      && GET_CODE (operands[0]) == MEM)
     {
-      int regnum = true_regnum (operands[1]);
-      /* regnum may be -1 in which case the test below will fail.  */	
+      int regnum;
+
+      if (reload_in_progress || reload_completed)
+	regnum = true_regnum (operands[1]);
+      else if (GET_CODE (operands[1]) == REG)
+	regnum = REGNO (operands[1]);
+      else
+	regnum = -1;
       
       /* If operands[1] is a register, on POWER it may have
 	 double-precision data in it, so truncate it to single


then over last night I built stage1 and used that to compile r_sign.i
from my original message.  Whereas a clean CVS checkout would crash as
expected with -O0, with the above patch it compiles.

A full bootstrap on my AIX4 box will take much longer but I so far I
think your patch solves the problem and should be installed.  Or I can
install it if you want (just send me the ChangeLog line.)  Thanks for
the quick response and solution. :-)

		--Kaveh
--
Kaveh R. Ghazi			Engagement Manager / Project Services
ghazi@caip.rutgers.edu		Qwest Internet Solutions


More information about the Gcc-bugs mailing list