This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [debug/13267] proposed patch to dwarf2out.c


> So where did the MEM come from then?  How come the value is a REG in
> rtl_for_decl_location and then magically a MEM in
> add_location_or_const_value_attribute?  That doesn't make sense.  Please
> elaborate.

Ok, it's a misunderstanding.  The REG we see in rtl_for_decl_location
is for "u" but the MEM we later is for "l".  Consider the testcase:

  signed char foo (register signed char u)
  {
    register signed char l = u;
  
    l = bar (l);
    return (l);
  }

The MEM isn't picked up in rtl_for_decl_location because it isn't a
PARM_DECL.  It's a VAR_DECL.  Here are the two DECLs:


 <parm_decl 0xb7412870 u
    type <integer_type 0xb749f288 signed char asm_written QI
        size <integer_cst 0xb749d104 constant 8>
        unit size <integer_cst 0xb749d118 constant 1>
        align 8 symtab -1220435712 alias set -1 precision 8 min <integer_cst 0xb749d0dc -128> max <integer_cst 0xb749d0f0 127>>
    used regdecl QI file bug2.c line 6 size <integer_cst 0xb749d104 8> unit size <integer_cst 0xb749d118 1>
    align 8 context <function_decl 0xb7412948 foo> result <integer_type 0xb749f288 signed char> initial <integer_type 0xb749f4a4 int>
    (reg/v:SI 1 r1 [orig:159 u ] [159])
    arg-type <integer_type 0xb749f4a4 int SI
        size <integer_cst 0xb749d21c constant 32>
        unit size <integer_cst 0xb749d2a8 constant 4>
        align 32 symtab 0 alias set -1 precision 32 min <integer_cst 0xb749d280 -2147483648> max <integer_cst 0xb749d294 2147483647>
        pointer_to_this <pointer_type 0xb7485ca8>> arg-type-as-written <integer_type 0xb749f288 signed char>
    incoming-rtl (reg:SI 4 r4 [ u ])>


 <var_decl 0xb7412a8c l
    type <integer_type 0xb749f288 signed char asm_written QI
        size <integer_cst 0xb749d104 constant 8>
        unit size <integer_cst 0xb749d118 constant 1>
        align 8 symtab -1220435712 alias set -1 precision 8 min <integer_cst 0xb749d0dc -128> max <integer_cst 0xb749d0f0 127>>
    used regdecl QI file bug2.c line 8 size <integer_cst 0xb749d104 8> unit size <integer_cst 0xb749d118 1>
    align 8 context <function_decl 0xb7412948 foo> initial <parm_decl 0xb7412870 u>
    (mem:SI (reg/f:SI 14 r14) [0 l+0 S4 A32])>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]