This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug bootstrap/67030] [6 Regression] ARM bootstrap failure due to [-Werror=tautological-compare]


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))


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]