[PATCH] Fix SUBREG_BYTE bug in dbxout.c

Richard Henderson rth@redhat.com
Fri Aug 3 13:46:00 GMT 2001


On Fri, Aug 03, 2001 at 08:24:26PM +0200, Jakub Jelinek wrote:
> +	  regno = REGNO (alter_subreg (home));
>  	}
> -      regno = REGNO (alter_subreg (home));
> +      else
> +	alter_subreg (home);

I don't understand this logic.  Particularly, calling alter_subreg and
discarding the result.  Wouldn't something like this make more sense?


r~



Index: dbxout.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/dbxout.c,v
retrieving revision 1.99
diff -c -p -d -u -r1.99 dbxout.c
--- dbxout.c	2001/07/26 06:56:12	1.99
+++ dbxout.c	2001/08/03 20:45:47
@@ -2090,6 +2090,9 @@ dbxout_symbol_location (decl, type, suff
   int letter = 0;
   int regno = -1;
 
+  if (GET_CODE (home) == SUBREG)
+    home = alter_subreg (home);
+
   /* Don't mention a variable at all
      if it was completely optimized into nothingness.
      
@@ -2101,19 +2104,6 @@ dbxout_symbol_location (decl, type, suff
       regno = REGNO (home);
       if (regno >= FIRST_PSEUDO_REGISTER)
 	return 0;
-    }
-  else if (GET_CODE (home) == SUBREG)
-    {
-      rtx value = home;
-
-      while (GET_CODE (value) == SUBREG)
-	value = SUBREG_REG (value);
-      if (GET_CODE (value) == REG)
-	{
-	  if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
-	    return 0;
-	}
-      regno = REGNO (alter_subreg (home));
     }
 
   /* The kind-of-variable letter depends on where



More information about the Gcc-patches mailing list