This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug bootstrap/67030] [6 Regression] ARM bootstrap failure due to [-Werror=tautological-compare]
- From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 27 Jul 2015 16:05:51 +0000
- Subject: [Bug bootstrap/67030] [6 Regression] ARM bootstrap failure due to [-Werror=tautological-compare]
- Auto-submitted: auto-generated
- References: <bug-67030-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67030
--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
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))