From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119364 invoked by alias); 27 Jul 2015 16:05:55 -0000 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 Received: (qmail 119306 invoked by uid 48); 27 Jul 2015 16:05:51 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/67030] [6 Regression] ARM bootstrap failure due to [-Werror=tautological-compare] Date: Mon, 27 Jul 2015 16:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 6.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg02354.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67030 --- Comment #1 from Marek Polacek --- Could you please try whether this patch helps? diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index 6a79b95..9fe9c5e 100644 --- a/gcc/c-family/c-common.c +++ b/gcc/c-family/c-common.c @@ -1890,6 +1890,10 @@ warn_tautological_cmp (location_t loc, enum tree_code code, tree lhs, tree rhs) if (TREE_CODE_CLASS (code) != tcc_comparison) return; + if (from_macro_expansion_at (EXPR_LOCATION (lhs)) + || from_macro_expansion_at (EXPR_LOCATION (rhs))) + return; + /* We do not warn for constants because they are typical of macro expansions that test for features, sizeof, and similar. */ if (CONSTANT_CLASS_P (lhs) || CONSTANT_CLASS_P (rhs))