This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/80959] -Wreturn-type "control reaches end of non-void function" false positive with -fsanitize=address
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 02 Jun 2017 13:07:50 +0000
- Subject: [Bug c/80959] -Wreturn-type "control reaches end of non-void function" false positive with -fsanitize=address
- Auto-submitted: auto-generated
- References: <bug-80959-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80959
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic,
| |missed-optimization
Status|UNCONFIRMED |NEW
Last reconfirmed| |2017-06-02
CC| |mliska at suse dot cz
Ever confirmed|0 |1
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Looks like it is caused by
try
{
...
}
finally
{
ASAN_MARK (POISON, &n, 4);
}
which eventually gets to
<bb 5> [0.00%]:
ASAN_MARK (POISON, &n, 4);
switch (finally_tmp.2) <default: <L8> [0.00%], case 1: <L5> [0.00%]>
<L5> [0.00%]:
<bb 7> [0.00%]:
return;
<L8> [0.00%]:
return D.2131;
thus it lacks a return. That's also visible in .original:
{
int n;
int n;
bar (&n);
switch (i)
{
case 1:;
switch (i)
{
default:;
return 0;
}
goto <D.2128>;
default:;
return 0;
}
<D.2128>:;
}
but I guess that "dead" break; after the inner switch was previously
CFG cleaned-up.