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

Reload pass broken


The function loc_mentioned_in_p contains a bogus if-else nesting.  Another
ambigous else occurs in delete_output_reload.


1998-10-24  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

	* reload.c (loc_mentioned_in_p): Fix if-else nesting.
	* reload1.c (delete_output_reload): Avoid ambigous else.

--- egcs-2.92/gcc/reload.c.~1~	Thu Oct 22 21:13:21 1998
+++ egcs-2.92/gcc/reload.c	Sat Oct 24 10:02:47 1998
@@ -1586,8 +1586,10 @@
       if (loc == &XEXP (in, i))
 	return 1;
       if (fmt[i] == 'e')
-	if (loc_mentioned_in_p (loc, XEXP (in, i)))
-	  return 1;
+	{
+	  if (loc_mentioned_in_p (loc, XEXP (in, i)))
+	    return 1;
+	}
       else if (fmt[i] == 'E')
 	for (j = XVECLEN (in, i) - 1; i >= 0; i--)
 	  if (loc_mentioned_in_p (loc, XVECEXP (in, i, j)))
--- egcs-2.92/gcc/reload1.c.~1~	Thu Oct 22 21:13:32 1998
+++ egcs-2.92/gcc/reload1.c	Sat Oct 24 10:09:51 1998
@@ -8112,19 +8112,21 @@
       while (GET_CODE (reg2) == SUBREG)
 	reg2 = SUBREG_REG (reg2);
       if (rtx_equal_p (reg2, reg))
-	if (reload_inherited[k] || reload_override_in[k] || k == j)
-	  {
-	    n_inherited++;
-	    reg2 = reload_out_reg[k];
-	    if (! reg2)
-	      continue;
-	    while (GET_CODE (reg2) == SUBREG)
-	      reg2 = XEXP (reg2, 0);
-	    if (rtx_equal_p (reg2, reg))
+	{
+	  if (reload_inherited[k] || reload_override_in[k] || k == j)
+	    {
 	      n_inherited++;
-	  }
-	else
-	  return;
+	      reg2 = reload_out_reg[k];
+	      if (! reg2)
+		continue;
+	      while (GET_CODE (reg2) == SUBREG)
+		reg2 = XEXP (reg2, 0);
+	      if (rtx_equal_p (reg2, reg))
+		n_inherited++;
+	    }
+	  else
+	    return;
+	}
     }
   n_occurrences = count_occurrences (PATTERN (insn), reg);
   if (substed)


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