public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgcc/97316] New: config/libbid/bid64_noncomp.c: 7 * pointless test ?
@ 2020-10-07  9:28 dcb314 at hotmail dot com
  0 siblings, 0 replies; only message in thread
From: dcb314 at hotmail dot com @ 2020-10-07  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 97316
           Summary: config/libbid/bid64_noncomp.c: 7 * pointless test ?
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgcc
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

1.

trunk.git/libgcc/config/libbid/bid64_noncomp.c:91:39: style: Mismatching
assignment and comparison, comparison 'sig_x==0' is always false.
[assignIfError]

The source code is

      sig_x = (x & MASK_BINARY_SIG2) | MASK_BINARY_OR2;
      // check for zero or non-canonical
      if (sig_x > 9999999999999999ull || sig_x == 0) {

but

$ fgrep MASK_BINARY_OR2 `find trunk.git/libgcc/config/libbid -name \*.h -print`
trunk.git/libgcc/config/libbid/bid_internal.h:#define MASK_BINARY_OR2          
      0x0020000000000000ull
$

so the test for sig_x == 0 does look pointless to me.

Some duplicates in the same file:

trunk.git/libgcc/config/libbid/bid64_noncomp.c:143:39: style: Mismatching
assignment and comparison, comparison 'sig_x==0' is always false.
[assignIfError]
trunk.git/libgcc/config/libbid/bid64_noncomp.c:391:37: style: Mismatching
assignment and comparison, comparison 'sig_x==0' is always false.
[assignIfError]
trunk.git/libgcc/config/libbid/bid64_noncomp.c:614:37: style: Mismatching
assignment and comparison, comparison 'sig_x==0' is always false.
[assignIfError]
trunk.git/libgcc/config/libbid/bid64_noncomp.c:629:37: style: Mismatching
assignment and comparison, comparison 'sig_y==0' is always false.
[assignIfError]
trunk.git/libgcc/config/libbid/bid64_noncomp.c:836:37: style: Mismatching
assignment and comparison, comparison 'sig_x==0' is always false.
[assignIfError]
trunk.git/libgcc/config/libbid/bid64_noncomp.c:852:37: style: Mismatching
assignment and comparison, comparison 'sig_y==0' is always false.
[assignIfError]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-07  9:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-07  9:28 [Bug libgcc/97316] New: config/libbid/bid64_noncomp.c: 7 * pointless test ? dcb314 at hotmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).