From patchwork Sun Feb 4 20:39:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kratochvil X-Patchwork-Id: 25790 Received: (qmail 73550 invoked by alias); 4 Feb 2018 20:39:29 -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 73460 invoked by uid 89); 4 Feb 2018 20:39:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_SHORT, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=Hx-languages-length:1394, UD:htm X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 04 Feb 2018 20:39:27 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6EF1A2820A for ; Sun, 4 Feb 2018 20:39:26 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-57.ams2.redhat.com [10.36.116.57]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AAF5785586; Sun, 4 Feb 2018 20:39:25 +0000 (UTC) Date: Sun, 4 Feb 2018 21:39:23 +0100 From: Jan Kratochvil To: gdb-patches@sourceware.org Cc: Kevin Buettner Subject: [patch] ppc64: Fix stwux encoding Message-ID: <20180204203902.GA10037@host1.jankratochvil.net> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.9.1 (2017-09-22) Hi, with gcc-8.0.1-0.9.fc28.x86_64 I get: ../../gdb/rs6000-tdep.c: In function 'CORE_ADDR skip_prologue(gdbarch*, CORE_ADDR, CORE_ADDR, rs6000_framedata*)': ../../gdb/rs6000-tdep.c:1911:34: error: bitwise comparison always evaluates to false [-Werror=tautological-compare] else if ((op & 0xfc1f016a) == 0x7c01016e) ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~ The code is there since: commit 98f08d3d9b69b344bb8b0cd2a4bda1cf4d966e20 Author: Kevin Buettner Date: Thu May 29 19:47:14 2003 +0000 From Jimi X : * rs6000-tdep.c (skip_prologue): Improve support for 64-bit code. So I do not think we can find the original author. https://www.ibm.com/support/knowledgecenter/en/ssw_aix_72/com.ibm.aix.alangref/idalangref_stwux_stux_instrs.htm says bit 21 - 30 = 183 Those are bits 1..10 in normal bit order: 183<<1 = 0x16e OK for check-in? Jan gdb/ChangeLog 2018-02-04 Jan Kratochvil * rs6000-tdep.c (skip_prologue): Fix stwux encoding. --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -1857,7 +1857,7 @@ skip_prologue (struct gdbarch *gdbarch, CORE_ADDR pc, CORE_ADDR lim_pc, offset = fdata->offset; continue; } - else if ((op & 0xfc1f016a) == 0x7c01016e) + else if ((op & 0xfc1f016e) == 0x7c01016e) { /* stwux rX,r1,rY */ /* No way to figure out what r1 is going to be. */ fdata->frameless = 0;