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 c/82149] New: match.pd: 2919: bad if test ?


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

            Bug ID: 82149
           Summary: match.pd: 2919: bad if test ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

As a result of a build with -Wlogical-op

generic-match.c:1358:77: warning: logical ‘or’ of collectively exhaustive tests
is always true [-Wlogical-op]

Source code is

       bool exception_p
         = real_isnan (cst) && (cst->signalling
                || (cmp != EQ_EXPR || cmp != NE_EXPR));

Maybe better code

       bool exception_p
         = real_isnan (cst) && (cst->signalling
                || (cmp != EQ_EXPR && cmp != NE_EXPR));

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