dbxout.c (dbxout_parms): Correctly describe parameters passed by invisible reference in registers...

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
This commit is contained in:
Jim Blandy 2000-12-02 00:18:46 +00:00 committed by Geoffrey Keating
parent 08106825b9
commit 27646dba39
2 changed files with 31 additions and 20 deletions

View 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.

View 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);
}
}
}
}