https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
Martin Sebor changed:
What|Removed |Added
Status|ASSIGNED|RESOLVED
Resolution|---
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
--- Comment #6 from Martin Sebor ---
Author: msebor
Date: Tue Jul 9 04:15:42 2019
New Revision: 273261
URL: https://gcc.gnu.org/viewcvs?rev=273261=gcc=rev
Log:
PR middle-end/71924 - missing -Wreturn-local-addr returning alloca result
PR
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
Martin Sebor changed:
What|Removed |Added
Keywords||patch
--- Comment #5 from Martin Sebor
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
Martin Sebor changed:
What|Removed |Added
Status|NEW |ASSIGNED
Assignee|unassigned
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
--- Comment #3 from Martin Sebor ---
On second thought, the right fix is to report the problem consistently for all
kinds of storage, including auto variables, alloca-ted storage, and compound
literals.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
Richard Biener changed:
What|Removed |Added
Status|UNCONFIRMED |NEW
Last reconfirmed|
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
--- Comment #2 from Martin Sebor ---
Returning [the address of] a compound literal, or any indirectly referenced
object (such as those in comment #1), suffers from the same limitation.
Compiling the program with -O2 (but not -O1) does produce
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
--- Comment #1 from Andrew Pinski ---
I expect we also miss:
void* foo1 (void)
{
char a [4];
char *b = a;
return b;
}
void* foo2 (void)
{
char *b = (char[4]){0, 0, 0, 0};
return b;
}
Basically we don't do any flow analysis for this
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71924
Andrew Pinski changed:
What|Removed |Added
Severity|normal |enhancement