diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2020-05-21 13:22:10 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2020-05-21 13:22:10 -0400 |
commit | aa370940e202a165ddc0be2fdc4383a82101a678 (patch) | |
tree | 09eb4a59b9058d5b4b9e1a1ae399b16241a145f5 /gdb | |
parent | 84d53fa9d281f057af5916f8663bc9a2872c5f6e (diff) | |
download | binutils-aa370940e202a165ddc0be2fdc4383a82101a678.zip binutils-aa370940e202a165ddc0be2fdc4383a82101a678.tar.gz binutils-aa370940e202a165ddc0be2fdc4383a82101a678.tar.bz2 |
gdb: fix -Wtautological-overlap-compare error in lm32-tdep.c
Building with clang 11, we get:
/home/smarchi/src/binutils-gdb/gdb/lm32-tdep.c:84:44: error: overlapping comparisons always evaluate to false [-Werror,-Wtautological-overlap-compare]
return ((regnum >= SIM_LM32_EA_REGNUM) && (regnum <= SIM_LM32_BA_REGNUM))
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Indeed, this doesn't make sense, as EA_REGNUM is greater than BA_REGNUM.
I'll assume that it was just a mistake and that these two should be
swapped.
The regnums for BA and EA are contiguous, so ultimately this particular
part of the condition is only true if regnum is == EA or == BA. These
registers are Exception Address and Breakpoint Address, so I guess it
makes sense for them to be in the system register group.
The relevant reference is here:
https://www.latticesemi.com/-/media/LatticeSemi/Documents/UserManuals/JL/LatticeMico32ProcessorReferenceManual39.ashx?document_id=52077
gdb/ChangeLog:
* lm32-tdep.c (lm32_register_reggroup_p): Fix condition.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 4 | ||||
-rw-r--r-- | gdb/lm32-tdep.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 4574440..0b38daf 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,9 @@ 2020-05-21 Simon Marchi <simon.marchi@efficios.com> + * lm32-tdep.c (lm32_register_reggroup_p): Fix condition. + +2020-05-21 Simon Marchi <simon.marchi@efficios.com> + * coffread.c (patch_type): Remove NULL check before xfree. * corefile.c (set_gnutarget): Likewise. * cp-abi.c (set_cp_abi_as_auto_default): Likewise. diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index 6b5bb15..73f8ae7 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -81,7 +81,7 @@ lm32_register_reggroup_p (struct gdbarch *gdbarch, int regnum, return ((regnum >= SIM_LM32_R0_REGNUM) && (regnum <= SIM_LM32_RA_REGNUM)) || (regnum == SIM_LM32_PC_REGNUM); else if (group == system_reggroup) - return ((regnum >= SIM_LM32_EA_REGNUM) && (regnum <= SIM_LM32_BA_REGNUM)) + return ((regnum >= SIM_LM32_BA_REGNUM) && (regnum <= SIM_LM32_EA_REGNUM)) || ((regnum >= SIM_LM32_EID_REGNUM) && (regnum <= SIM_LM32_IP_REGNUM)); return default_register_reggroup_p (gdbarch, regnum, group); } |