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

--- Comment #5 from Martin Liška <marxin at gcc dot gnu.org> ---
One can trigger it only with one debug counter value:
-fdbg-cnt=ipa_mod_ref:869-869 (and multiple LTRANS partitions).

The only changed function is in:
comp_unit_maybe_decode_line_info (struct comp_unit * unit)
...

--- good/addr2line.ltrans7.ltrans.122t.dom2     2020-10-27 10:06:56.935982898
+0100
+++ bad/addr2line.ltrans7.ltrans.122t.dom2      2020-10-27 10:06:29.248177802
+0100
@@ -25035,6 +25035,8 @@
 threading bb 269 up to 16 stmts
 threading bb 269 kills 1 stmts
 threading bb 269 up to 16 stmts
+***dbgcnt: lower limit 869 reached for ipa_mod_ref.***
+***dbgcnt: upper limit 869 reached for ipa_mod_ref.***
 threading bb 141 kills 9 stmts
 threading bb 141 up to 24 stmts
 threading bb 139 kills 2 stmts
@@ -27429,9 +27431,9 @@
   # DEBUG dir => dir_142
   # DEBUG BEGIN_STMT
   _143 = line_ptr;
-  _144 = bytes_read;
-  _145 = (sizetype) _144;
-  _146 = _143 + _145;
+  _144 = _481;
+  _145 = _138;
+  _146 = _143 + _138;
   line_ptr = _146;
   # DEBUG BEGIN_STMT
   _147 = _bfd_safe_read_leb128.constprop (_146, &bytes_read, 0, line_end_55);

The change is:

***dbgcnt: lower limit 869 reached for ipa_mod_ref.***
***dbgcnt: upper limit 869 reached for ipa_mod_ref.***
ipa-modref: call stmt _141 = _bfd_safe_read_leb128.constprop (_140,
&bytes_read, 0, line_end_55);
ipa-modref: call to _bfd_safe_read_leb128.constprop/17919 does not clobber ref:
bytes_read alias sets: 7->7
FIND: _481
  Replaced redundant expr '[../bfd/../../bfd/dwarf2.c:2321:13] bytes_read' with
'_481'
==== ASGN _144 = _481

Reply via email to