Commit 3e44547c by Jason Merrill Committed by Jason Merrill

re PR bootstrap/68346 (Bootstrap failure on i686-linux)

	PR bootstrap/68346

	* c-common.c (warn_tautological_cmp): Fold before checking for
	constants.

From-SVN: r230471
parent 3212c3c8
2015-11-17 Jason Merrill <jason@redhat.com>
PR bootstrap/68346
* c-common.c (warn_tautological_cmp): Fold before checking for
constants.
2015-11-16 Marek Polacek <polacek@redhat.com> 2015-11-16 Marek Polacek <polacek@redhat.com>
PR c++/68362 PR c++/68362
......
...@@ -1924,7 +1924,7 @@ warn_tautological_cmp (location_t loc, enum tree_code code, tree lhs, tree rhs) ...@@ -1924,7 +1924,7 @@ warn_tautological_cmp (location_t loc, enum tree_code code, tree lhs, tree rhs)
/* We do not warn for constants because they are typical of macro /* We do not warn for constants because they are typical of macro
expansions that test for features, sizeof, and similar. */ expansions that test for features, sizeof, and similar. */
if (CONSTANT_CLASS_P (lhs) || CONSTANT_CLASS_P (rhs)) if (CONSTANT_CLASS_P (fold (lhs)) || CONSTANT_CLASS_P (fold (rhs)))
return; return;
/* Don't warn for e.g. /* Don't warn for e.g.
......
// PR bootstrap/68346
// { dg-options -Wtautological-compare }
#define INVALID_REGNUM (~(unsigned int) 0)
#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
int main()
{
if ((unsigned) PIC_OFFSET_TABLE_REGNUM != INVALID_REGNUM)
__builtin_abort();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment