Re: -Wtautological-bitwise-compare error in arm-tdep.c

Simon Marchi
2020-05-15T20:57:49Z

On 2020-05-15 4:41 p.m., Luis Machado wrote:
> On 5/15/20 5:32 PM, Simon Marchi via Gdb-patches wrote:
>> We get this error in arm-tdep.c when building with clang 11:
>>
>>    CXX    arm-tdep.o
>> /home/smarchi/src/binutils-gdb/gdb/arm-tdep.c:934:29: error: bitwise comparison always evaluates to false [-Werror,-Wtautological-bitwise-compare]
>>            else if ((insn & 0xffb0) == 0xe950    /* ldrd Rt, Rt2,
>>                     ~~~~~~~~~~~~~~~~^~~~~~~~~
>>
>> Indeed, this can never evaluate to true.  I tried to look at what the condition
>> should be, but it's a bit too deep into ARM instruction encoding for me.  I am
>> pretty sure that the corresponding section in the ARM Architecture Reference
>> Manual [1] is F3.1.15, if somebody wants to take a stab at it.
>>
>> Simon
>>
>> [1] https://static.docs.arm.com/ddi0487/fb/DDI0487F_b_armv8_arm.pdf
>>
>
> Thanks for reporting this. I'll look into it. It may be a typo of some kind.

Yes, I suppose, it's just not a trivial typo to fix!

Simon