From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6263 invoked by alias); 19 Oct 2018 11:31:52 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 6228 invoked by uid 89); 19 Oct 2018 11:31:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy= 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; Fri, 19 Oct 2018 11:31:50 +0000 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2D2BF3082B4E; Fri, 19 Oct 2018 11:31:49 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5BC8C1001640; Fri, 19 Oct 2018 11:31:48 +0000 (UTC) Subject: Re: [PATCH v3 2/3] Pass return_method to _push_dummy_call To: Alan Hayward , gdb-patches@sourceware.org References: <20181011144905.66908-1-alan.hayward@arm.com> <20181011144905.66908-3-alan.hayward@arm.com> Cc: nd@arm.com From: Pedro Alves Message-ID: Date: Fri, 19 Oct 2018 11:31:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181011144905.66908-3-alan.hayward@arm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00426.txt.bz2 On 10/11/2018 03:49 PM, Alan Hayward wrote: > /* First determine how much stack space we will need. */ > - for (i = 0, argreg = E_1ST_ARGREG + (struct_return != 0); i < nargs; i++) > + for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct); > + i < nargs; i++) Please write: for (i = 0, argreg = E_1ST_ARGREG + (return_method == return_method_struct); i < nargs; i++) I.e., once you have to break one the statements, it reads better to break them all. > @@ -238,7 +239,7 @@ xstormy16_push_dummy_call (struct gdbarch *gdbarch, > > /* If struct_return is true, then the struct return address will > consume one argument-passing register. */ This comment needs a slight update. > - if (struct_return) > + if (return_method == return_method_struct) > @@ -1577,7 +1578,7 @@ aarch64_push_dummy_call (struct gdbarch *gdbarch, struct value *function, > } > > /* The struct_return pointer occupies X8. */ > - if (struct_return || lang_struct_return) > + if (return_method != return_method_normal) > { I think in this patch, this should still read: if (return_method == return_method_struct || lang_struct_return) So that the patch has no side effects other than passing the return_method down. Thanks, Pedro Alves