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

Luis Machado
2020-05-25T13:51:29Z

On 5/25/20 10:49 AM, Simon Marchi wrote:
> On 2020-05-25 9:08 a.m., Luis Machado wrote:
>> This fixes an instruction mask typo. We should be matching only
>> ldrd (immediate) and not any other of its variants. As is, it never matches
>> anything.
>
> And moreover, within the `ldrd (immediate)` instruction, it only matches the
> `Offset variant` variant, right?
>

That's right. We don't want to handle anything that changes the SP here.
And the post-indexed and pre-indexed variants do so.

>>
>> With the patch, the instruction mask also allows matching of ldrd (literal),
>> but the check for SP discards this particular instruction pattern, as it has
>> a hardcoded PC register.
>
> I don't feel the most qualified to approve this patch. Alan, could you please
> take a look?
>
> Simon
>