From patchwork Tue Oct 14 21:43:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 3230 Received: (qmail 19735 invoked by alias); 14 Oct 2014 21:43:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 19723 invoked by uid 89); 14 Oct 2014 21:43:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f53.google.com Received: from mail-pa0-f53.google.com (HELO mail-pa0-f53.google.com) (209.85.220.53) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 14 Oct 2014 21:43:21 +0000 Received: by mail-pa0-f53.google.com with SMTP id kq14so8700821pab.12 for ; Tue, 14 Oct 2014 14:43:19 -0700 (PDT) X-Received: by 10.66.66.167 with SMTP id g7mr7918325pat.66.1413322998206; Tue, 14 Oct 2014 14:43:18 -0700 (PDT) Received: from [192.168.1.103] ([223.72.65.33]) by mx.google.com with ESMTPSA id xf1sm12770917pbb.18.2014.10.14.14.43.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 Oct 2014 14:43:17 -0700 (PDT) Message-ID: <543D98F3.2030009@gmail.com> Date: Wed, 15 Oct 2014 05:43:15 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Andreas Schwab CC: gdb-patches@sourceware.org Subject: Re: [PATCH] gdb/hppa-tdep.c: Fix a logical typo bug found by compiler warning References: <543D93DD.5000906@gmail.com> <87d29uxrvg.fsf@igel.home> In-Reply-To: <87d29uxrvg.fsf@igel.home> On 10/15/2014 05:29 AM, Andreas Schwab wrote: > Chen Gang 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. 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. 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;