dbxout.c (dbxout_parms): Correctly describe parameters passed by invisible reference...
authorJim Blandy <jimb@redhat.com>
Sat, 2 Dec 2000 00:18:46 +0000 (00:18 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sat, 2 Dec 2000 00:18:46 +0000 (00:18 +0000)
2000-12-01  Jim Blandy  <jimb@redhat.com>

* dbxout.c (dbxout_parms): Correctly describe parameters passed by
  invisible reference in registers, but then spilled to the stack.
   Remove code to emit a second stab for such parameters; it attempts
  to describe the value's location by introducing a synthetic C++
  `reference' type, and then saying the stack slot has that
  reference type.  This loses type information (breaking GDB's
  `ptype' command, among other things) just to describe a location
  which stabs can represent correctly in other ways.

From-SVN: r37936

gcc/ChangeLog
gcc/dbxout.c

index 007d98c4e8311474a7de6b053e2aedffbaabc53a..82cbc8f601432ca837cf6a6613149095bd50d54e 100644 (file)
@@ -1,3 +1,14 @@
+2000-12-01  Jim Blandy  <jimb@redhat.com>
+
+       * dbxout.c (dbxout_parms): Correctly describe parameters passed by
+       invisible reference in registers, but then spilled to the stack.
+       Remove code to emit a second stab for such parameters; it attempts
+       to describe the value's location by introducing a synthetic C++
+       `reference' type, and then saying the stack slot has that
+       reference type.  This loses type information (breaking GDB's
+       `ptype' command, among other things) just to describe a location
+       which stabs can represent correctly in other ways.
+
 2000-12-01  Alexandre Oliva  <aoliva@redhat.com>
 
        * final.c (output_addr_const) <PLUS>: Don't assume at least one
@@ -533,6 +544,7 @@ Tue Nov 28 09:53:50 2000  Richard Kenner  <kenner@vlsi1.ultra.nyu.edu>
        Merge handling of -D and -U.  Update handling of pending
        directives.  Free the memory after use.
 
+>>>>>>> 1.8477
 2000-11-27  Bernd Schmidt  <bernds@redhat.co.uk>
 
        * flow.c (entry_exit_blocks): Add entry for cond_local_set.
index 2c147f64109654233f3a8227e357ae70661187fe..268a6c6a0ab567f1a17e97c62bebec32a859cc72 100644 (file)
@@ -2469,6 +2469,24 @@ dbxout_parms (parms)
            dbxout_type (TREE_TYPE (parms), 0, 0);
            dbxout_finish_symbol (parms);
          }
+       else if (GET_CODE (DECL_RTL (parms)) == MEM
+                && GET_CODE (XEXP (DECL_RTL (parms), 0)) == MEM)
+         {
+           /* Parm was passed via invisible reference, with the reference
+              living on the stack.  DECL_RTL looks like
+              (MEM (MEM (PLUS (REG ...) (CONST_INT ...)))).  */
+           const char *decl_name = (DECL_NAME (parms)
+                                    ? IDENTIFIER_POINTER (DECL_NAME (parms))
+                                    : "(anon)");
+           current_sym_value
+             = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1));
+           current_sym_addr = 0;
+             
+           FORCE_TEXT;
+           fprintf (asmfile, "%s\"%s:v", ASM_STABS_OP, decl_name);
+           dbxout_type (TREE_TYPE (parms), 0, 0);
+           dbxout_finish_symbol (parms);
+         }
        else if (GET_CODE (DECL_RTL (parms)) == MEM
                 && XEXP (DECL_RTL (parms), 0) != const0_rtx
                 /* ??? A constant address for a parm can happen
@@ -2477,22 +2495,14 @@ dbxout_parms (parms)
                 && ! CONSTANT_P (XEXP (DECL_RTL (parms), 0)))
          {
            /* Parm was passed in registers but lives on the stack.  */
-           int aux_sym_value = 0;
 
            current_sym_code = N_PSYM;
            /* DECL_RTL looks like (MEM (PLUS (REG...) (CONST_INT...))),
               in which case we want the value of that CONST_INT,
-              or (MEM (REG ...)) or (MEM (MEM ...)),
+              or (MEM (REG ...)),
               in which case we use a value of zero.  */
            if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == REG)
              current_sym_value = 0;
-           else if (GET_CODE (XEXP (DECL_RTL (parms), 0)) == MEM)
-             {
-               /* Remember the location on the stack the parm is moved to */
-               aux_sym_value
-                 = INTVAL (XEXP (XEXP (XEXP (DECL_RTL (parms), 0), 0), 1));
-               current_sym_value = 0;
-             }
            else
                current_sym_value
                  = INTVAL (XEXP (XEXP (DECL_RTL (parms), 0), 1));
@@ -2532,17 +2542,6 @@ dbxout_parms (parms)
                                     XEXP (DECL_RTL (parms), 0));
            dbxout_type (TREE_TYPE (parms), 0, 0);
            dbxout_finish_symbol (parms);
-           if (aux_sym_value != 0)
-             {
-               /* Generate an entry for the stack location */
-
-               fprintf (asmfile, "%s\"%s:", ASM_STABS_OP,
-                        IDENTIFIER_POINTER (DECL_NAME (parms)));
-               current_sym_value = aux_sym_value;
-               current_sym_code = N_LSYM;
-               dbxout_type (build_reference_type (TREE_TYPE (parms)), 0, 0);
-               dbxout_finish_symbol (parms);
-             }
          }
       }
 }