]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
m68k: Quiet up cppcheck warning [PR114689]
authorJakub Jelinek <jakub@redhat.com>
Mon, 15 Apr 2024 15:46:03 +0000 (17:46 +0200)
committerJakub Jelinek <jakub@redhat.com>
Mon, 15 Apr 2024 15:46:03 +0000 (17:46 +0200)
cppcheck apparently warns on the | !!sticky part of the expression and
using | (!!sticky) quiets it up (it is correct as is).
The following patch adds the ()s, and also adds them around mant >> 1 just
in case it makes it clearer to all readers that the expression is parsed
that way already.

2024-04-15  Jakub Jelinek  <jakub@redhat.com>

PR libgcc/114689
* config/m68k/fpgnulib.c (__truncdfsf2): Add parentheses around
!!sticky bitwise or operand to quiet up cppcheck.  Add parentheses
around mant >> 1 bitwise or operand.

libgcc/config/m68k/fpgnulib.c

index 986750e052350c13f7aa1a895879ad0a4e3aeb5a..04f62998f6efda05833e61ca817eeec323e7c8f2 100644 (file)
@@ -302,7 +302,7 @@ __truncdfsf2 (double a1)
   if (exp == EXPDMASK - EXCESSD + EXCESS)
     {
       exp = EXPMASK;
-      mant = mant >> 1 | (mant & 1) | !!sticky;
+      mant = (mant >> 1) | (mant & 1) | (!!sticky);
     }
   else
     {