On Feb 11, 2025, Richard Biener <rguent...@suse.de> wrote:

> Alex, is this OK for trunk?

>> PR middle-end/118801
>> * tree-ssa-dce.cc (eliminate_unnecessary_stmts): Prune
>> sequences of uninterrupted DEBUG BEGIN_STMTs, keeping only
>> the last of a set with unique location.

It seems like a reasonable trade-off.  Without consumers for location
views, there's no use in carrying these duplicates.

I'd have added an option or a parameter to control this compression, but
that's just me.


If we had consumers for views, this would be discarding potentially
useful and correct information, but we can cross that bridge if we ever
get to it.

Then, instead of deleting debug begin stmts, we could compress them, so
that a single debug stmt could carry a sequence of any number of debug
begin stmts without intervening code or even side effects (debug binds).
One might benefit from being able to single-step, in a debugger, source
stmts for which some code and state was expected, even if nothing
remained in the end.

With this compression I propose, we'd be able to output all location
information without slowing down stmt walks.

But we have no use for that now, so please go ahead with your patch.

Sorry about the delay.

-- 
Alexandre Oliva, happy hacker            https://blog.lx.oliva.nom.br/
Free Software Activist     FSFLA co-founder     GNU Toolchain Engineer
Learn the truth about Richard Stallman at https://stallmansupport.org/

Reply via email to