From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9994 invoked by alias); 18 Oct 2011 08:26:49 -0000 Received: (qmail 9952 invoked by uid 22791); 18 Oct 2011 08:26:46 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 Oct 2011 08:26:29 +0000 From: "rguenther at suse dot de" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/48087] [4.5/4.6/4.7 Regression] -Wall -Werror adds warnings over and above those generated by -Wall Date: Tue, 18 Oct 2011 08:26:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenther at suse dot de X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-10/txt/msg01749.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087 --- Comment #5 from rguenther at suse dot de 2011-10-18 08:26:04 UTC --- On Tue, 18 Oct 2011, paolo.carlini at oracle dot com wrote: > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48087 > > Paolo Carlini changed: > > What |Removed |Added > ---------------------------------------------------------------------------- > Status|UNCONFIRMED |NEW > Last reconfirmed| |2011-10-18 > CC| |paolo.carlini at oracle dot > | |com > Ever Confirmed|0 |1 > > --- Comment #2 from Paolo Carlini 2011-10-18 01:18:24 UTC --- > Well, this does, it (fixes both) but I don't know if we are aiming for > something better, no good including the whole "diagnostic.h"?!? > > Index: tree-cfg.c > =================================================================== > --- tree-cfg.c (revision 180119) > +++ tree-cfg.c (working copy) > @@ -37,7 +37,7 @@ along with GCC; see the file COPYING3. If not see > #include "timevar.h" > #include "tree-dump.h" > #include "tree-pass.h" > -#include "diagnostic-core.h" > +#include "diagnostic.h" > #include "except.h" > #include "cfgloop.h" > #include "cfglayout.h" > @@ -7380,7 +7380,8 @@ execute_warn_function_return (void) > else if (warn_return_type > && !TREE_NO_WARNING (cfun->decl) > && EDGE_COUNT (EXIT_BLOCK_PTR->preds) > 0 > - && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl)))) > + && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (cfun->decl))) > + && !errorcount) > { > FOR_EACH_EDGE (e, ei, EXIT_BLOCK_PTR->preds) > { I don't think that's good. You'll miss the warning for subsequent functions that do not have errors for example. Either we want to generally supress all warnings once we emitted an error (then this should be done in generic diagnostic machinery), or we shouldn't bother with this. We can make the generic machinery track errors per function if we like to.