From: Jim Blandy Date: Sat, 2 Dec 2000 00:18:46 +0000 (+0000) Subject: dbxout.c (dbxout_parms): Correctly describe parameters passed by invisible reference... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=27646dba39c421705f0a651bf68223680e3351e9;p=gcc.git dbxout.c (dbxout_parms): Correctly describe parameters passed by invisible reference in registers... 2000-12-01 Jim Blandy * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 007d98c4e83..82cbc8f6014 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2000-12-01 Jim Blandy + + * 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 * final.c (output_addr_const) : Don't assume at least one @@ -533,6 +544,7 @@ Tue Nov 28 09:53:50 2000 Richard Kenner Merge handling of -D and -U. Update handling of pending directives. Free the memory after use. +>>>>>>> 1.8477 2000-11-27 Bernd Schmidt * flow.c (entry_exit_blocks): Add entry for cond_local_set. diff --git a/gcc/dbxout.c b/gcc/dbxout.c index 2c147f64109..268a6c6a0ab 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -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); - } } } }