<div dir="ltr">Thanks for this writeup!<div class="gmail_extra"><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">  Passes that move code around or shorten the execution paths like SROA<br>
  and LICM should go to great lengths to preserve the debug intrinsics<br>
  that correspond the the name and value of the variables. It would be<br>
  an unrealistic goal to try and keep the stepping behavior inside a<br>
  debugger intact after running such passes.<br>
<br>
  Instead, different optimization methods can be used when debugging is a<br>
  high priority. Ones that don't move code around as much and of course<br>
  result in longer execution times, but what they lose in speed they<br>
  give back with a more robust debug experience.<br>
<br></blockquote><div><br></div><div>Absolutely.  I think we should make -O2/-O3 as debugable as possible without sacrificing performance, and then whatever is left becomes a prime candidate for assessing whether we can get away with turning it off or turning it down for -Og.</div><div><br></div></div></div></div>