]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gas: Fix x86 build with GCC 6.4
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Mar 2024 16:08:02 +0000 (08:08 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 8 Mar 2024 16:08:02 +0000 (08:08 -0800)
Add "()" to silence GCC 6.4:

.../gas/config/tc-i386.c: In function ‘x86_ginsn_lea’:
.../gas/config/tc-i386.c:5738:19: error: logical not is only applied to the left hand side of comparison [-Werror=logical-not-parentheses]
   if (!i.base_reg != (!i.index_reg || i.index_reg->reg_num == RegIZ))
                   ^~
cc1: all warnings being treated as errors

PR gas/31464
* config/tc-i386.c (x86_ginsn_lea): Add "()" to silence GCC 6.4.

gas/config/tc-i386.c

index fecb25a3fe2fe9e8bc2a97a338fbc3e089ca98a4..532f8f58b0a55098740fb58a63016d1a5b6eaaa6 100644 (file)
@@ -5735,7 +5735,7 @@ x86_ginsn_lea (const symbolS *insn_end_sym)
   unsigned int dst_reg;
   bool index_regiz_p;
 
-  if (!i.base_reg != (!i.index_reg || i.index_reg->reg_num == RegIZ))
+  if ((!i.base_reg) != (!i.index_reg || i.index_reg->reg_num == RegIZ))
     {
       /* lea disp(%base), %dst    or    lea disp(,%index,imm), %dst.
         Either index_reg or base_reg exists, but not both.  Further, as per