https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89791

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aoliva at gcc dot gnu.org

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Here we have sth looking like a dup of PR89463 but not fixed by its patch. 
With
the patch we end up with

main ()
{
  <bb 2> [local count: 1073741824]:
  [t.c:2:5] # DEBUG BEGIN_STMT
  [t.c:2:9] # DEBUG i => 0
  [t.c:3:5] # DEBUG BEGIN_STMT
  # DEBUG i => NULL
  [t.c:5:5] # DEBUG BEGIN_STMT
  [t.c:5:5] optimize_me_not ();
  [<built-in>:0:0] return 0;

and in .final:

(note 1 0 3 NOTE_INSN_DELETED)
(note 3 1 20 2 [bb 2] NOTE_INSN_BASIC_BLOCK)
(note 20 3 2 2 NOTE_INSN_PROLOGUE_END)
(note 2 20 27 2 NOTE_INSN_FUNCTION_BEG)
(note 27 2 30 2 t.c:2 NOTE_INSN_BEGIN_STMT)
(note 30 27 28 2 (var_location i (const_int 0 [0])) NOTE_INSN_VAR_LOCATION)
(note 28 30 31 2 t.c:3 NOTE_INSN_BEGIN_STMT)
(note 31 28 29 2 (var_location i (nil)) NOTE_INSN_VAR_LOCATION)
(note 29 31 24 2 t.c:5 NOTE_INSN_BEGIN_STMT)
...
(call_insn:TI 11 24 25 2 (set (reg:SI 0 ax)
        (call (mem:QI (symbol_ref:DI ("optimize_me_not") [flags 0x3] 
<function_decl 0x7fa85fd3f100 optimize_me_not>) [0 optimize_me_not S1 A8])
            (const_int 0 [0]))) "t.c":5:5 677 {*call_value}

which looks good to me.  But then we still get

 <2><133>: Abbrev Number: 4 (DW_TAG_variable)
    <134>   DW_AT_name        : i
    <136>   DW_AT_decl_file   : 1
    <137>   DW_AT_decl_line   : 2
    <138>   DW_AT_decl_column : 9
    <139>   DW_AT_type        : <0x165>
    <13d>   DW_AT_location    : 0x2 (location list)
    <141>   DW_AT_GNU_locviews: 0x0

    00000002 v000000000000002 v000000000000003 views at 00000000 for:
             00000000004003e0 00000000004003e0 (DW_OP_lit0; DW_OP_stack_value)

so we somehow lost the optimized-out association?  Or is my consumer
just not behaving? (gdb 8.2)

Reply via email to