I'd be happy with just getting <optimized out>, instead of actively wrong results. One of these days I'll get around to seeing if GCC is significantly less bad than Clang about that….
-
-
-
Or "use of undeclared identifier" when an identifier is clearly in scope, which I'm getting now…
- Show replies
New conversation -
-
-
What should happen in instances where the variable is actually optimized out? I understand that a lot of this is just lazy and/or incorrect DWARF but in some cases variables just no longer exist, if the compiler replaced a loop with its closed form for example.
-
You can generate a DWARF expression for the variable that says what the value is in terms of other variables.
- Show replies
New conversation -
-
-
How is this a hot take? It's the only possible take
-
I assume the opposing take is “it’s too hard or this is impossible so we shouldn’t do anything”
- Show replies
New conversation -
-
-
I think some of them are actually legitimate, where the potential visibility of the value (at least one its own, not as part of common subexpressions) has ended. But most are toolchain bugs where the value is clearly used again and can't be discarded.
-
But even if the value is no longer live, you could rematerialize it from other live variables.
- Show replies
New conversation -
-
-
If that still appears with -O0 -g, then it most certainly is a toolchain bug.
-
It should work even at -O2. :)
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.