Re: [PATCH] gdb/hppa-tdep.c: Fix a logical typo bug found by compiler warning

Chen Gang
2014-10-14T21:43:23Z

On 10/15/2014 05:29 AM, Andreas Schwab wrote:
> Chen Gang <gang.chen.5i5j@gmail.com> writes:
>
>> && (((inst >> 6) & 0xf) == 0x8
>> - || (inst >> 6) & 0xf) == 0x9))
>> + || ((inst >> 6) & 0xf) == 0x9)))
>
> ((inst >> 6) & 0xe) == 8
>
> Andreas.
>

I guess, your fixing may like below, which will be a different logical
working flow.

diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 627f31a..3112732 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1402,8 +1402,8 @@ inst_saves_gr (unsigned long inst)
too. */
if ((inst >> 26) == 0x19 || (inst >> 26) == 0x18
|| ((inst >> 26) == 0x3
- && (((inst >> 6) & 0xf) == 0x8
- || (inst >> 6) & 0xf) == 0x9))
+ && ((inst >> 6) & 0xf) == 0x8
+ || ((inst >> 6) & 0xf) == 0x9))
return hppa_extract_5R_store (inst);

return 0;

If you are sure it is, please help send related patch with more details
comments for it (excuse me, I am not quite familiar the related logical
details).

Thanks.
--
Chen Gang

Open share and attitude like air water and life which God blessed