[Bug bootstrap/67030] [6 Regression] ARM bootstrap failure due to [-Werror=tautological-compare]
mpolacek at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jul 27 16:51:00 GMT 2015
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67030
--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
(In reply to ktkachov from comment #3)
> Unfortunately still getting the error.
Sorry about that.
> One thing I missed out from the original error message is this note:
>
> error: self-comparison always evaluates to false
> [-Werror=tautological-compare]
> #define SUPPORTS_STACK_ALIGNMENT (MAX_STACK_ALIGNMENT > STACK_BOUNDARY)
>
> $SRC/gcc/cfgexpand.c:1268:7: note: in expansion of macro
> 'SUPPORTS_STACK_ALIGNMENT'
> if (SUPPORTS_STACK_ALIGNMENT
> ^
>
> Don't know if that helps.
Actually, that helps. I bet the following works. Mind giving this one a spin?
--- 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))
More information about the Gcc-bugs
mailing list