On Fri, 15 Aug 2014, Manuel López-Ibáñez wrote:

> On 15 August 2014 11:07, Richard Biener <rguent...@suse.de> wrote:
> > -  if (TREE_CODE (arg1) == INTEGER_CST)
> > +  if (CONSTANT_CLASS_P (arg1) == INTEGER_CST)
> 
> Huh?

Eh ;)

> /* Nonzero if NODE represents a constant.  */
> 
> #define CONSTANT_CLASS_P(NODE)\
>     (TREE_CODE_CLASS (TREE_CODE (NODE)) == tcc_constant)
> 
> Sadly, we don't have a warning for this, but clang++ has one:
> 
> test.c:4:16: warning: comparison of constant 2 with expression of type
> 'bool' is always false [-Wtautological-constant-out-of-range-compare]
>   if ((a == 1) == 2) {
>       ~~~~~~~~ ^  ~
> 
> I'll open a PR

Thx.
Richard.

Reply via email to