From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5821 invoked by alias); 19 Oct 2011 01:44:30 -0000 Received: (qmail 5812 invoked by uid 22791); 19 Oct 2011 01:44:29 -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; Wed, 19 Oct 2011 01:44:14 +0000 From: "manu at gcc dot gnu.org" 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: Wed, 19 Oct 2011 01:44: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: manu at gcc dot gnu.org 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" Content-Transfer-Encoding: quoted-printable 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/msg01897.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D48087 --- Comment #12 from Manuel L=C3=B3pez-Ib=C3=A1=C3=B1ez 2011-10-19 01:44:12 UTC --- I think the problem is the seen_error() test in gimple_push_cleanup. I am guessing that it does some kind of "folding" that is skipped when an error = has been issued. There are two issues here: 1) Warnings converted to errors are not real errors, that is, the program is still valid and we could in principle do whatever stuff we would do for a v= alid program. We could do s/seen_error/seen_any_error/, and then add seen_real_e= rror (program_is_invalid). I bet most of the cases using seen_any_error, actually mean program_is_invalid. 2) Whether even with real errors, we can fix the gimple generated by C++ to= not trigger the Wreturn-type warning. Or alternatively, make Wreturn-type more intelligent to not emit a bogus warning here. The point here is that it is perhaps possible to generate such a gimple from C++ that causes a bogus warning. Currently, gimplify_push_cleanup "fixes" the bad gimple to avoid t= he warning, but perhaps in other testcases, this "fix" doesn't trigger and we = get a bogus warning. The thing is that even if we fix 1, we could probably trigger a real error earlier and we end up with 2 (no inconsistency, but still bogus warning).