This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR c/16351 Extend Wnonnull for returns_nonnull
- From: Manuel LÃpez-IbÃÃez <lopezibanez at gmail dot com>
- To: Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: Jeff Law <law at redhat dot com>, Gcc Patch List <gcc-patches at gcc dot gnu dot org>, Jason Merrill <jason at redhat dot com>, "Joseph S. Myers" <joseph at codesourcery dot com>
- Date: Sat, 25 Jul 2015 00:41:22 +0200
- Subject: Re: PR c/16351 Extend Wnonnull for returns_nonnull
- Authentication-results: sourceware.org; auth=none
- References: <CAESRpQAZT7syOqgusqXQEgigUj3UeTfi5iD9CHJKGCAnVfA7Ug at mail dot gmail dot com> <55B127D7 dot 3020202 at redhat dot com> <CAESRpQCe4GTYNqnpeH+TMC3F7G75k1G_cHsQnb-K93sH7et3_Q at mail dot gmail dot com> <55B29270 dot 1030206 at redhat dot com> <CAESRpQBErJnZaiffGugor5ay9YTo3xbkyWQkHqsFKQND6ianCA at mail dot gmail dot com> <CA+C-WL8EFO-YdiFLF24AdQ-NJRACFtBL9Ef+PN6F0zGcvTrVSA at mail dot gmail dot com>
On 25 July 2015 at 00:17, Patrick Palka <patrick@parcs.ath.cx> wrote:
> On Fri, Jul 24, 2015 at 5:55 PM, Manuel LÃpez-IbÃÃez
> <lopezibanez@gmail.com> wrote:
> Is there a PR for this particular test case? I am interested in
> improving the uninit analysis for gcc 6 so this potentially seems up
> my alley.
We do not warn because of the infamous PR18501 (probably the
-Wuninitialized bug with the highest number of duplicates), where CPP
removes the default SSA definition of n and simply returns 1
unconditionally. But fixing PR18501 may not be necessary to detect
this case (Clang does it before doing any optimization).
There are other cases that would be better warned from the FE:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=19808
Cheers,
Manuel.
.