From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28511 invoked by alias); 15 Aug 2011 15:32:24 -0000 Received: (qmail 28498 invoked by uid 22791); 15 Aug 2011 15:32:23 -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; Mon, 15 Aug 2011 15:32:09 +0000 From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/50082] -Wstrict-overflow mishandles typedef Date: Mon, 15 Aug 2011 15:48:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth 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" 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-08/txt/msg01369.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50082 --- Comment #4 from Richard Guenther 2011-08-15 15:31:37 UTC --- (In reply to comment #2) > Not sure I understand your question about tree-ssa-forwprop.c. Are you saying > that overflow warnings are already deferred at that point, so that passing > WARN_STRICT_OVERFLOW_CONDITIONAL causes extraneous warnings to be issued? Are > overflow warnings already deferred during tree-ssa-forwprop.c? Because if they > aren't deferred then I don't see why changing the last argument to > fold_undefer_overflow_warnings would make any difference. No, but the warning is defered as WARN_STRICT_OVERFLOW_MAGNITUDE and then re-issued as WARN_STRICT_OVERFLOW_CONDITIONAL. I'm not sure why forwprop "raises" the severity forcefully - maybe you'd remember? Maybe you remember why you added the ability to forcefully override? The issue is hidden now on trunk, still visible on the 4.6 branch and with obfuscating the testcase to void insert_cache_boundary_ok (int gap_start, int i) { int tem; if (i < 0) __builtin_abort (); tem = i - 1; if (tem < gap_start) __builtin_abort (); } also on trunk. It should warn for -Wstrict-overflow=5 but not for -Wstrict-overflow=1. I suppose the forwprop code wants to force a warning at -Wstrict-overflow=1 if the conditional becomes optimized to a constant at compile-time?