[Bug tree-optimization/108023] Incorrect line number in ASAN's report

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Dec 8 21:00:43 GMT 2022


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|sanitizer                   |tree-optimization
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2022-12-08

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
LIM loses the line #.
We go from:
  <bb 6> [local count: 955630225]:
  # b.1_46 = PHI <_16(6), [/app/example.cpp:16:17 discrim 1] 0(5)>
  [/app/example.cpp:17:7] # DEBUG BEGIN_STMT
  [/app/example.cpp:17:17] _9 = *j_1;
  [/app/example.cpp:17:19] _11 = (long unsigned int) h_45;
  [/app/example.cpp:17:20] _12 = _11 * 4;
  [/app/example.cpp:17:20] _13 = _9 + _12;
  [/app/example.cpp:17:20] _14 = *_13;
  [/app/example.cpp:17:12] MEM[(int *)k_8 + 12B] = _14;
  [/app/example.cpp:16:5 discrim 3] # DEBUG BEGIN_STMT
  [/app/example.cpp:16:5 discrim 3] _16 = b.1_46 + 1;
  [/app/example.cpp:16:5 discrim 3] b = _16;
  [/app/example.cpp:16:17 discrim 1] # DEBUG BEGIN_STMT
  [/app/example.cpp:16:17 discrim 1] if (_16 <= 2)
    goto <bb 6>; [89.00%]
  else
    goto <bb 7>; [11.00%]

To:
  <bb 6> [local count: 955630225]:
  # b.1_46 = PHI <_16(10), [/app/example.cpp:16:17 discrim 1] 0(5)>
  [/app/example.cpp:17:7] # DEBUG BEGIN_STMT
  [/app/example.cpp:17:12] k__lsm.10_48 = _14;
  [/app/example.cpp:16:5 discrim 3] # DEBUG BEGIN_STMT
  [/app/example.cpp:16:5 discrim 3] _16 = b.1_46 + 1;
  [/app/example.cpp:16:5 discrim 3] b_lsm.11_26 = _16;
  [/app/example.cpp:16:17 discrim 1] # DEBUG BEGIN_STMT
  [/app/example.cpp:16:17 discrim 1] if (_16 <= 2)
    goto <bb 10>; [89.00%]
  else
    goto <bb 7>; [11.00%]

  <bb 10> [local count: 850510901]:
  goto <bb 6>; [100.00%]

  <bb 7> [local count: 118111600]:
  # b_lsm.11_36 = PHI <b_lsm.11_26(6)>
  # k__lsm.10_6 = PHI <k__lsm.10_48(6)>
  MEM[(int *)k_8 + 12B] = k__lsm.10_6;
  b = b_lsm.11_36;

Seems like LIM could in theory copy the line # but that might even confuse
people while debugging ....

I don't know what the best appoarch here really.
Just use -Og instead?


More information about the Gcc-bugs mailing list