01e27f8
2001-08-03  Jakub Jelinek  <jakub@redhat.com>
01e27f8
01e27f8
	* dbxout.c (dbxout_symbol_location): Only set regno for register
01e27f8
	SUBREG.
01e27f8
01e27f8
	* g++.old-deja/g++.other/debug10.C: New testcase.
01e27f8
01e27f8
--- gcc/dbxout.c.jj	Tue Jul 24 20:41:21 2001
01e27f8
+++ gcc/dbxout.c	Fri Aug  3 20:26:17 2001
01e27f8
@@ -2024,8 +2024,10 @@ dbxout_symbol_location (decl, type, suff
01e27f8
 	{
01e27f8
 	  if (REGNO (value) >= FIRST_PSEUDO_REGISTER)
01e27f8
 	    return 0;
01e27f8
+	  regno = REGNO (alter_subreg (home));
01e27f8
 	}
01e27f8
-      regno = REGNO (alter_subreg (home));
01e27f8
+      else
01e27f8
+	alter_subreg (home);
01e27f8
     }
01e27f8
 
01e27f8
   /* The kind-of-variable letter depends on where
01e27f8
--- gcc/testsuite/g++.old-deja/g++.other/debug10.C.jj	Fri Aug  3 20:31:05 2001
01e27f8
+++ gcc/testsuite/g++.old-deja/g++.other/debug10.C	Fri Aug  3 20:31:12 2001
01e27f8
@@ -0,0 +1,24 @@
01e27f8
+// Build don't link:
01e27f8
+// Special g++ Options: -g -O
01e27f8
+
01e27f8
+struct A
01e27f8
+{
01e27f8
+  int e();
01e27f8
+  A &f(double &);
01e27f8
+};
01e27f8
+
01e27f8
+int A::e()
01e27f8
+{
01e27f8
+  return 0;
01e27f8
+}
01e27f8
+
01e27f8
+A &A::f(double &a)
01e27f8
+{
01e27f8
+  union {
01e27f8
+    double x;
01e27f8
+    char y[8];
01e27f8
+  };
01e27f8
+  y[0] = e();
01e27f8
+  a = x;
01e27f8
+  return *this;
01e27f8
+}