From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id A51623854805 for ; Fri, 30 Apr 2021 08:59:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A51623854805 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 4A04431B; Fri, 30 Apr 2021 01:59:39 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C8D0D3F73B; Fri, 30 Apr 2021 01:59:38 -0700 (PDT) From: Richard Sandiford To: "H.J. Lu via Gcc-patches" Mail-Followup-To: "H.J. Lu via Gcc-patches" , "H.J. Lu" , richard.sandiford@arm.com Subject: Re: [PATCH 01/12] Update alignment_for_piecewise_move References: <20210429125415.1634118-1-hjl.tools@gmail.com> <20210429125415.1634118-2-hjl.tools@gmail.com> Date: Fri, 30 Apr 2021 09:59:37 +0100 In-Reply-To: <20210429125415.1634118-2-hjl.tools@gmail.com> (H. J. Lu via Gcc-patches's message of "Thu, 29 Apr 2021 05:54:04 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Apr 2021 08:59:41 -0000 "H.J. Lu via Gcc-patches" writes: > alignment_for_piecewise_move is called only with MOVE_MAX_PIECES or > STORE_MAX_PIECES, which are the number of bytes at a time that we > can move or store efficiently. We should call mode_for_size without > limit to MAX_FIXED_MODE_SIZE, which is an integer expression for the > size in bits of the largest integer machine mode that should actually > be used, may be smaller than MOVE_MAX_PIECES or STORE_MAX_PIECES, which > may use vector. > > * expr.c (alignment_for_piecewise_move): Call mode_for_size > without limit to MAX_FIXED_MODE_SIZE. OK. I agree it doesn't make sense to apply the limit here, given that the size is entirely under the target's control anyway. And it should be safe, since any target that sets MOVE_MAX_PIECES or STORE_MAX_PIECES higher than MAX_FIXED_MODE_SIZE would trigger the require () assert. Thanks, Richard > --- > gcc/expr.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/gcc/expr.c b/gcc/expr.c > index e0167b77410..b4c110f8c17 100644 > --- a/gcc/expr.c > +++ b/gcc/expr.c > @@ -746,7 +746,7 @@ static unsigned int > alignment_for_piecewise_move (unsigned int max_pieces, unsigned int align) > { > scalar_int_mode tmode > - = int_mode_for_size (max_pieces * BITS_PER_UNIT, 1).require (); > + = int_mode_for_size (max_pieces * BITS_PER_UNIT, 0).require (); > > if (align >= GET_MODE_ALIGNMENT (tmode)) > align = GET_MODE_ALIGNMENT (tmode);