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]
Other format: [Raw text]

Re: [CFT] kill darwin encode_section_info, rev 2


On Wed, May 14, 2003 at 07:44:39AM +0200, Andreas Tobler wrote:
> ../../gcc/gcc/unwind-dw2.c: In function `uw_install_context_1':
> ../../gcc/gcc/unwind-dw2.c:1291: internal compiler error: Segmentation Fault

Blah, this was stupid.  No idea why it didn't show up 
in my "test one of everything" test case...


r~


--- config/rs6000/rs6000.c.old	2003-05-14 00:14:19.000000000 -0700
+++ config/rs6000/rs6000.c	2003-05-14 00:21:06.000000000 -0700
@@ -8935,12 +8935,16 @@
     }
   else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == REG)
     {
-      if (REGNO (XEXP (x, 0)) == 0)
-	fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 1)) ],
-		 reg_names[ REGNO (XEXP (x, 0)) ]);
-      else
-	fprintf (file, "%s,%s", reg_names[ REGNO (XEXP (x, 0)) ],
-		 reg_names[ REGNO (XEXP (x, 1)) ]);
+      unsigned int r0 = REGNO (XEXP (x, 0));
+      unsigned int r1 = REGNO (XEXP (x, 1));
+
+      if (r0 == 0)
+	{
+	  unsigned int tmp;
+	  tmp = r0; r0 = r1; r1 = tmp;
+	}
+
+      fprintf (file, "%s,%s", reg_names[r0], reg_names[r1]);
     }
   else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
     {
@@ -8950,30 +8954,19 @@
   else if (GET_CODE (x) == LO_SUM && GET_CODE (XEXP (x, 0)) == REG
            && CONSTANT_P (XEXP (x, 1)))
     {
+      unsigned int regno = REGNO (XEXP (x, 0));
+
+      x = XEXP (x, 1);
       if (TARGET_ELF)
 	{
-	  output_addr_const (file, XEXP (x, 1));
-	  fprintf (file, "@l(%s)", reg_names[ REGNO (XEXP (x, 0)) ]);
+	  output_addr_const (file, x);
+	  fprintf (file, "@l(%s)", reg_names[regno]);
 	}
       else if (TARGET_MACHO)
 	{
 	  fputs ("lo16(", file);
-
-	  x = XEXP (x, 1);
-	  if (GET_CODE (x) == CONST
-	      && GET_CODE (XEXP (x, 0)) == UNSPEC
-	      && XINT (XEXP (x, 0), 1) == UNSPEC_MPIC_NLP)
-	    machopic_print_non_lazy_ptr_operand (XVECEXP (XEXP (x, 0), 0, 0));
-	  else
-	    {
-	      output_addr_const (file, x);
-	      if (MACHOPIC_PURE)
-		{
-		  fputc ('-', file);
-		  output_asm_label (machopic_function_base_label);
-		}
-	    }
-	  fprintf (file, ")(%s)", reg_names[ REGNO (XEXP (x, 0)) ]);
+	  output_addr_const (file, x);
+	  fprintf (file, ")(%s)", reg_names[regno]);
 	}
     }
   else if (legitimate_constant_pool_address_p (x))


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