On 15 August 2014 14:43, Franz Sirl <franz.sirl-ker...@lauterbach.com> wrote: > Am 15.08.2014 um 11:32 schrieb Manuel López-Ibáñez: >> 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? >> >> /* 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 > > See also PR 44077
Thanks! I marked it as duplicate since Marek took the other one. Hopefully this will be fixed for GCC 5