From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6894 invoked by alias); 8 Nov 2018 14:37:22 -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 6881 invoked by uid 89); 8 Nov 2018 14:37:21 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=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.2 spammy= X-HELO: mail-wr1-f68.google.com Received: from mail-wr1-f68.google.com (HELO mail-wr1-f68.google.com) (209.85.221.68) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 08 Nov 2018 14:37:20 +0000 Received: by mail-wr1-f68.google.com with SMTP id k15-v6so18521018wre.12 for ; Thu, 08 Nov 2018 06:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=YPzPW1NuZRf5gqADZQHD8yluW5KzM2EAvs0T59x6FnI=; b=bySSwcCiTxpFOMM1YdkwqvXXAITEJjqOIZYjPsF+96Ml7ygLiTgtBPcEbugRXwAwcx YRqVxRpF4yi7+LsFHXBpLwK1Xz4u6NW9nK2qJG2pJdllMz3Ah40WUyrtzSPwhmL+ij0e Gqc6kFSNppGh0eKEiifeqe64fh8Smu64hxNUoFra10W8Si5iA0Hnd6O+lY453dx4IpzC X1MbdlSxVdb2yiz+1CIT/YSUz4yt/pSYgFYrQ3NwctDAepxcrup0Pnwt4zz650FGUxMO 66cnnS1u56cDDtmr5y6Prc+e4F7w0sWKMiVTwh6Na8g5yqw6gouZbfnAiBjAfinLIM0x mVMw== Return-Path: Received: from localhost ([2a02:390:741d:1:3665:d267:b319:d766]) by smtp.gmail.com with ESMTPSA id t198-v6sm6598202wmd.9.2018.11.08.06.37.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Nov 2018 06:37:17 -0800 (PST) Date: Thu, 08 Nov 2018 14:37:00 -0000 From: Andrew Burgess To: Jim Wilson Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 2/3] RISC-V: gdb.base/gnu_vector fixes. Message-ID: <20181108143716.GY16539@embecosm.com> References: <20181106214428.22262-1-jimw@sifive.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181106214428.22262-1-jimw@sifive.com> X-Fortune: Microsoft gives you Windows... Linux gives you the whole house. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-11/txt/msg00118.txt.bz2 * Jim Wilson [2018-11-06 13:44:28 -0800]: > GCC gives vectors natural aligment based on total size, not element size, > bounded by the maximum supported type alignment. > > gdb/ > * riscv-tdep.c (BIGGEST_ALIGNMENT): New. > (riscv_type_alignment) : If TYPE_VECTOR, return min > of TYPE_LENGTH and BIGGEST_ALIGNMENT. As with patch #1, please update the patch title line. > --- > gdb/riscv-tdep.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c > index ac4f2533f4..3d4f7e3dcc 100644 > --- a/gdb/riscv-tdep.c > +++ b/gdb/riscv-tdep.c > @@ -59,6 +59,9 @@ > /* The stack must be 16-byte aligned. */ > #define SP_ALIGNMENT 16 > > +/* The biggest alignment that the target supports. */ > +#define BIGGEST_ALIGNMENT 16 > + > /* Forward declarations. */ > static bool riscv_has_feature (struct gdbarch *gdbarch, char feature); > > @@ -1640,6 +1643,10 @@ riscv_type_alignment (struct type *t) > return TYPE_LENGTH (t); > > case TYPE_CODE_ARRAY: > + if (TYPE_VECTOR (t)) > + return std::min (TYPE_LENGTH (t), (unsigned)BIGGEST_ALIGNMENT); I think there's supposed to be a space after the cast, '(unsigned) BIGGEST_ALIGNMENT'. > + /* FALLTHROUGH */ > + > case TYPE_CODE_COMPLEX: > return riscv_type_alignment (TYPE_TARGET_TYPE (t)); > > -- > 2.17.1 > Otherwise, look fine. Thanks, Andrew