[PATCH] gdb: fix -Wtautological-overlap-compare warning in mips-linux-tdep.c
Maciej W. Rozycki
macro@linux-mips.org
Sat May 16 13:29:54 GMT 2020
On Fri, 15 May 2020, Simon Marchi wrote:
> diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
> index aa7b8d11f3fb..ae067c19dfa7 100644
> --- a/gdb/mips-linux-tdep.c
> +++ b/gdb/mips-linux-tdep.c
> @@ -633,16 +633,14 @@ mips_linux_in_dynsym_stub (CORE_ADDR pc)
> if (n64)
> {
> /* 'daddu t7,ra' or 'or t7, ra, zero'*/
> - if (insn != 0x03e0782d || insn != 0x03e07825)
> + if (insn == 0x03e0782d || insn == 0x03e07825)
Nope, this ought to be:
if (insn != 0x03e0782d && insn != 0x03e07825)
> return 0;
> -
> }
> else
> {
> /* 'addu t7,ra' or 'or t7, ra, zero'*/
> - if (insn != 0x03e07821 || insn != 0x03e07825)
> + if (insn == 0x03e07821 || insn == 0x03e07825)
Likewise:
if (insn != 0x03e07821 && insn != 0x03e07825)
Thanks for looking into it (and for cc-ing me)!
Maciej
More information about the Gdb-patches
mailing list