https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105346
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|WAITING |NEW
Keywords| |diagnostic
--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Tim Van Holder from comment #4)
> Marking as C++ rather than C; while Bison generates C code, here it gets
> compiled in C++ context (with a namespace wrapped around Bison's symbols).
Thanks, I can confirm the diagnostic with -O0, it goes away when optimizing.
The issue seems to be that yyss (or yymsg) are not assigned to anywhere
in the function and so we essentially have
void foo()
{
char buf[20];
char *bufp = buf;
if (bufp != buf)
free (bufp);
}
which we diagnose. When optimizing the test is optimized away.