On Mar 26, 2020, Jakub Jelinek <ja...@redhat.com> wrote: > Or disable -gstatement-frontiers by default and declare it -fcompare-debug > incompatible.
I don't get what makes debug stmts introduced by -gstatement-frontiers special in this regard. I recall working a lot on making statement list management compatible with debug stmts for -fcompare-debug purposes back when introducing them, but not breaking new ground when extending them with markers rather than binds. > Or perhaps just a flag on the STATEMENT_LIST that would make it clear the > STATEMENT_LIST wouldn't be there without -g. Or different tree code like > STATEMENT_LIST, except that it would be only this kind of container. IIRC part of the problem in ensuring isomorphism for -fcompare-debug is that sometimes we end up with redundant STATEMENT_LISTs in the non-debug case, and then we can't tell whether a STATEMENT_LIST is to be significant or not in the debug case. A flag for STATEMENT_LIST, or maybe an alternate node type that amounted to an easier to recognize and manage transparent container for at most one nondebug stmt, and as many debug stmts as needed before and after it, might help avoid unintended differences. I'm not sure whether the separate node with direct access to the contained nondebug node would be advantageous. Maybe just recognizing this kind of node and turning it into a regular STATEMENT_LIST wherever we'd have created one would suffice. IIRC there are various operations of inserting stmts that search for nondebug stmts, and the direct link might help with them, if the flag alone wouldn't. -- Alexandre Oliva, freedom fighter he/him https://FSFLA.org/blogs/lxo/ Free Software Evangelist Stallman was right, but he's left :( GNU Toolchain Engineer Live long and free, and prosper ethically