From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20717 invoked by alias); 27 Jul 2015 17:01:10 -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 20677 invoked by uid 48); 27 Jul 2015 17:01:06 -0000 From: "ktkachov 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 17:01: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: ktkachov 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/msg02365.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67030 --- Comment #6 from ktkachov at gcc dot gnu.org --- (In reply to Marek Polacek from comment #4) > (In reply to ktkachov from comment #3) > > Actually, that helps. I bet the following works. Mind giving this one a > spin? Yes, that seems to work. Bootstrap proceeds from that point i.e. cfgexpand.c compiles. I have to go offline for the day, so I'll have the full bootstrap result tomorrow but from what I can see this is an obvious fix (to my limited C frontend experience) and it would be nice to have it in ASAP to fix arm bootstrap. Thanks for the quick response. > > --- a/gcc/c-family/c-common.c > +++ b/gcc/c-family/c-common.c > @@ -1890,6 +1890,11 @@ 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 (loc) > + || 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))