[Bug debug/89791] gcc generates wrong debug information at -O3

2019-04-01 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89791

Richard Biener  changed:

   What|Removed |Added

 Resolution|FIXED   |DUPLICATE

--- Comment #4 from Richard Biener  ---
Thus a duplicate.

*** This bug has been marked as a duplicate of bug 89463 ***

[Bug debug/89791] gcc generates wrong debug information at -O3

2019-03-31 Thread qrzhang at gatech dot edu
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89791

Qirun Zhang  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #3 from Qirun Zhang  ---
Fixed in r269961.

[Bug debug/89791] gcc generates wrong debug information at -O3

2019-03-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89791

Richard Biener  changed:

   What|Removed |Added

 CC||aoliva at gcc dot gnu.org

--- Comment #2 from Richard Biener  ---
Here we have sth looking like a dup of PR89463 but not fixed by its patch. 
With
the patch we end up with

main ()
{
   [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 ();
  [: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] 
) [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

0002 v002 v003 views at  for:
 004003e0 004003e0 (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)

[Bug debug/89791] gcc generates wrong debug information at -O3

2019-03-25 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89791

Richard Biener  changed:

   What|Removed |Added

   Keywords||wrong-debug
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2019-03-25
Version|unknown |9.0
 Ever confirmed|0   |1

--- Comment #1 from Richard Biener  ---
Confirmed.