This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/82149] New: match.pd: 2919: bad if test ?
- From: "dcb314 at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 08 Sep 2017 16:35:35 +0000
- Subject: [Bug c/82149] New: match.pd: 2919: bad if test ?
- Auto-submitted: auto-generated
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));