On Tue, Apr 21, 2015 at 04:19:26PM +0200, Manuel López-Ibáñez wrote: > On 21/04/15 13:16, Marek Polacek wrote: > >(-Wlogical-op still isn't enabled neither by -Wall nor by -Wextra.) > > The reason is https://gcc.gnu.org/PR61534 > > which means we don't want to warn for: > > extern int xxx; > #define XXX xxx > int test (void) > { > if (!XXX && xxx) > return 4; > else > return 0; > } > > (gcc/testsuite/gcc.dg/pr40172-3.c, although it should be moved to > c-c++-common) > > As noted in the PR: The problem is that !XXX becomes XXX == 0, but it has > the location of "!", which is not virtual. If we look at the argument of the > expression, then XXX is actually a var_decl, whose location corresponds to > the declaration and not the use, and it is not virtual either. This is > PR43486. > > > >Bootstrapped/regtested on x86_64-linux, ok for trunk? > > Does it pass bootstrap if you enable it? That is, is GCC itself -Wlogical-op > clean?
No, there are many issues e.g. in config/i386/i386.md exactly because of PR61534, that is, with this patch, we warn even for int var; #define TARGET_64BIT var #define TARGET_KEEPS_VECTOR_ALIGNED_STACK TARGET_64BIT int main () { if (TARGET_64BIT || TARGET_KEEPS_VECTOR_ALIGNED_STACK) return 1; } So the bug really must be solved first :(. I see I proposed a solution in the PR, I wonder whether that works... Marek