Note: Some of these use -fno-inline, while others use inline attributes.
Recently there has been renewed interest in improving debug-info for variables that (partially or otherwise) live on the stack in optimised code.
At the moment instcombine speculates that stack slots are probably going to be promoted to registers, and prepares the debug-info accordingly. It runs a function called LowerDbgDeclare which converts dbg.declares to a set of dbg.values after loads, and before stores and calls. Sometimes the stack location remains (e.g. for escaped locals). If any dbg.values become undef where the stack location is still valid we end up unnecessarily reducing variable location coverage due to our inability to track multiple locations simultaneously. There is a flag to disable this feature (-instcombine-lower-dbg-declare=0), which prevents this conversion at the cost of sometimes providing incorrect location info in the face of DSE, DCE, GVN, CSE etc.
This has been discussed fairly extensively on PR34136.
The idea of these tests is to provide examples of situations that we should consider when designing a new system, to aid discussions and eventually help evaluate the implementation.
Dexter isn't ideal for observing specific optimisation behaviour. Writing an exaustive test suite would be difficult, and the resultant suite would be fragile. That said, I think having some concrete executable examples is useful at least as a reference, and I'm hoping that other people might contribute further examples.
What do you think?
I think I'd prefer to standardize on attributes or -fno-inline everywhere. I had to scroll back pretty far to the RUN line to understand that alias would not be inlined. Having the attribute be in the code may be more readable.