From patchwork Thu Dec 19 00:01:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Terekhov, Mikhail via Gdb-patches" X-Patchwork-Id: 36955 Received: (qmail 120551 invoked by alias); 19 Dec 2019 00:01: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 120457 invoked by uid 89); 19 Dec 2019 00:01:22 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-21.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=55 X-HELO: mail-yw1-f73.google.com Received: from mail-yw1-f73.google.com (HELO mail-yw1-f73.google.com) (209.85.161.73) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Dec 2019 00:01:21 +0000 Received: by mail-yw1-f73.google.com with SMTP id y188so2690221ywa.4 for ; Wed, 18 Dec 2019 16:01:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=rIcZJa4iB3Br6I40ZYcW0JeOa57JslFY+t23mp3rYYI=; b=itVXbBpRYEJtooejbijig1R24wUgBgDu5a0IQRaRh/gPgzIUj2YkVgLkdoRdgSAAcy bHrrBF8gtfkYktd761tVh3hIYqjGUwDK9+MCUuBOYz3SnLfsJqHu5tQLx5iwSXpG2/4i AHqI/e4aNVVErDFwZA4T7Qp/UW+PguMNBGdnXCKvCMhNRbz23Kev75U9y8aaAT5wMTaD 4b+mj9NLfqmUVSPIjaehqxztWwGDhVPRrI2ol/TMdGWucaTcanRdVYrvLRslnhE3ZxaH gSuihik575YArBqidJ1fQsBv3L/hAOIAJhWdMPni+Vd2tUkaVZ7VIs42tW35mmhHuRTb zj/g== Date: Wed, 18 Dec 2019 18:01:03 -0600 In-Reply-To: <20191219000103.36667-1-cbiesinger@google.com> Message-Id: <20191219000103.36667-5-cbiesinger@google.com> Mime-Version: 1.0 References: <20191219000103.36667-1-cbiesinger@google.com> Subject: [PATCH 3/3] Make the literal argument to pow a double, not an integer X-Patchwork-Original-From: "Christian Biesinger via gdb-patches" From: "Terekhov, Mikhail via Gdb-patches" Reply-To: Christian Biesinger To: gdb-patches@sourceware.org Cc: Christian Biesinger X-IsSubscribed: yes Since pow takes doubles, pass 2.0 instead of 2 to pow (). Conveniently, this fixes the ambiguous call to pow on Solaris 11 with gcc 5.5 (gcc211 on the compile farm), which has a "using std::pow" directive in a system header, which brings in float/double/long double overloads. Fixes the build on Solaris with enable-targets=all. gdb/ChangeLog: 2019-12-18 Christian Biesinger * score-tdep.c (score7_analyze_prologue): Pass 2.0 instead of 2 to pow (). Change-Id: Ib18e7e4749ddcbff0727b72a31198f8cb84d1993 --- gdb/score-tdep.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 5ca763c40f..691051729e 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -918,13 +918,13 @@ score7_analyze_prologue (CORE_ADDR startaddr, CORE_ADDR pc, && G_FLD (inst->v, 2, 0) == 0x0) { /* subei! r0, n */ - sp_offset += (int) pow (2, G_FLD (inst->v, 6, 3)); + sp_offset += (int) pow (2.0, G_FLD (inst->v, 6, 3)); } else if (G_FLD (inst->v, 14, 7) == 0xc0 && G_FLD (inst->v, 2, 0) == 0x0) { /* addei! r0, n */ - sp_offset -= (int) pow (2, G_FLD (inst->v, 6, 3)); + sp_offset -= (int) pow (2.0, G_FLD (inst->v, 6, 3)); } } else