From patchwork Mon Apr 28 19:39:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Brobecker X-Patchwork-Id: 732 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 4F664360075 for ; Mon, 28 Apr 2014 12:39:37 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id 01468413B4D69; Mon, 28 Apr 2014 12:39:36 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id D3EA9413B4D48 for ; Mon, 28 Apr 2014 12:39:36 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; q=dns; s= default; b=q2tDnWiVg98T65ejU8DVFlErDpM9Ke+xfmcDXYGW5dtR3QfGahjZK AUnk/Ysp7PUY+zSKiGKbkf6VWaKlFOBm0INOJ+/s7ezgAJGTwlFAllxPhdNp+jTq Ol94K8MKHLJTEXUXyDPHDLCdTRLP8cSnQ+jEhRrQ/ZRvpAk/wGeJM8= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id; s=default; bh=/+9G9JWALulXKoi0CEZ/uVP4oyc=; b=Tl9tdfxQfeV2JN5mBT8pwVu+TWGY 1q3SouqV1hMjGICjpZARkVH1eGIe5tW+Ad1k0yh25PfxxhYXf3TqY6C5EUp8LKc8 ljQKZyaDScINC9vlFxYfOw/3+DFq9IWKnafWBuVajh78ySGDxCsTCIWFphW3+WFb XCJE2opOamuMG+w= Received: (qmail 30571 invoked by alias); 28 Apr 2014 19:39:34 -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 30559 invoked by uid 89); 28 Apr 2014 19:39:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL, BAYES_00, KAM_STOCKGEN, RP_MATCHES_RCVD, SPF_PASS autolearn=no version=3.3.2 X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 28 Apr 2014 19:39:33 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 4DCBA116167 for ; Mon, 28 Apr 2014 15:39:30 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Q6OZjgCpxTXi for ; Mon, 28 Apr 2014 15:39:30 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 37000116166 for ; Mon, 28 Apr 2014 15:39:30 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 0F4BBE0487; Mon, 28 Apr 2014 15:39:30 -0400 (EDT) From: Joel Brobecker To: gdb-patches@sourceware.org Subject: [pushed/Ada] remove unnecessary second call to static_unwrap_type in ada_evaluate_subexp Date: Mon, 28 Apr 2014 15:39:28 -0400 Message-Id: <1398713968-602-1-git-send-email-brobecker@adacore.com> X-DH-Original-To: gdb@patchwork.siddhesh.in In ada-lang.c::ada_evaluate_subexp, case OP_VAR_VALUE, when noside is EVAL_AVOID_SIDE_EFFECTS, the first thing we do is set type as follow: type = static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol)); Later on in the same block, we make the same call: return value_zero (to_static_fixed_type (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))), not_lval); This patch removes the second call, since it should result in the same type being returned, so no point in making that call again. gdb/ChangeLog: * ada-lang.c (ada_evaluate_subexp) : Remove unnecessary second call to static_unwrap_type. Tested on x86_64-linux, and pushed. Thanks, diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e1093cf..cd43f6e 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-04-28 Joel Brobecker + + * ada-lang.c (ada_evaluate_subexp) : Remove + unnecessary second call to static_unwrap_type. + 2014-04-27 Hui Zhu * stack.c (print_frame_info): Call do_gdb_disassembly with diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index da304ab..0acc1b5 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -10205,10 +10205,7 @@ ada_evaluate_subexp (struct type *expect_type, struct expression *exp, } *pos += 4; - return value_zero - (to_static_fixed_type - (static_unwrap_type (SYMBOL_TYPE (exp->elts[pc + 2].symbol))), - not_lval); + return value_zero (to_static_fixed_type (type), not_lval); } else {