https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728
Andrew Pinski changed:
What|Removed |Added
See Also||https://gcc.gnu.org/bugzill
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728
Andrew Pinski changed:
What|Removed |Added
CC||pinskia at gcc dot gnu.org
Se
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728
--- Comment #4 from felix-gcc at fefe dot de ---
If you do have a printf that references debug_cnt, it wouldn't be removed,
right?
If you expect unreferenced variables to not be optimized out, you can always
compile without optimizer. For local
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728
--- Comment #3 from Richard Biener ---
Btw, any such optimization would be prone to remove 'debug_cnt' in
void foo()
{
static int debug_cnt = 0;
debug_cnt++;
.. stuff ..
}
because here nothing depends on debug_cnt. For some printf-style
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105728
Richard Biener changed:
What|Removed |Added
Component|c |ipa
Last reconfirmed|