This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/81320] New: [7/8] -Wlogical-op diagnostic depends on comparison' order


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81320

            Bug ID: 81320
           Summary: [7/8] -Wlogical-op diagnostic depends on comparison'
                    order
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dimhen at gmail dot com
  Target Milestone: ---

r247015 FAIL
r249982 FAIL

$ cat x.c
int f1(int i)
{
    if( i == 0 ||
        i == 0 || /* PRESENT warning */
        i == 1  )
        return 0;
    else
        return 1;
}

int f2(int i)
{
    if( i == 0 ||
        i == 1 ||
        i == 0)   /* MISS warning */
        return 0;
    else
        return 1;
}

$ /usr/local/gcc_current/bin/gcc -Wall -Wextra -O -Wlogical-op -c x.c
x.c: In function ‘f1’:
x.c:3:16: warning: logical ‘or’ of equal expressions [-Wlogical-op]
     if( i == 0 ||
                ^~
$ /usr/local/gcc_current/bin/gcc -v
Using built-in specs.
COLLECT_GCC=/usr/local/gcc_current/bin/gcc
COLLECT_LTO_WRAPPER=/usr/local/gcc_current/libexec/gcc/x86_64-pc-linux-gnu/8.0.0/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
Target: x86_64-pc-linux-gnu
Configured with: /home/dimhen/src/gcc_current/configure
--prefix=/usr/local/gcc_current --enable-checking=yes,df,fold,rtl
--enable-languages=c,c++,lto --disable-multilib --enable-shared
--enable-threads=posix --enable-__cxa_atexit --disable-libunwind-exceptions
--enable-gnu-unique-object --enable-linker-build-id
--with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl
--enable-libmpx --enable-offload-targets=nvptx-none --without-cuda-driver
--enable-gnu-indirect-function --with-tune=generic
Thread model: posix
gcc version 8.0.0 20170705 (experimental) [trunk revision 249982] (GCC)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]