From patchwork Thu Oct 28 09:02:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 46733 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5FBB03858436 for ; Thu, 28 Oct 2021 09:02:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5FBB03858436 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1635411764; bh=NYVVWpeG6lkel/NJox1swm8256YjgI8kwnj8BU4hAuY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=gMaxajfTedAHyScjKzkMx7HNlQMkT/ml/ioG8IypnMjl/NhPogGmW2LHhYFMbliDP oqyXuej9aodattPcF67LGtgcV+L2CLcjwPA7cX2xScN7HigdtibHgC0qBHHJLRI+qH NbKYyAmB+w9xHEkwvYC7TDX3f1P1xODqCXpTqneg= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 65AC63858D39 for ; Thu, 28 Oct 2021 09:02:15 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 65AC63858D39 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 3D9EF1FD4B for ; Thu, 28 Oct 2021 09:02:14 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 2A90F139BE for ; Thu, 28 Oct 2021 09:02:14 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id PSFNCRZnemFNUQAAMHmgww (envelope-from ) for ; Thu, 28 Oct 2021 09:02:14 +0000 Date: Thu, 28 Oct 2021 11:02:13 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/102949 - fix base object alignment Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" This fixes fallout of g:4703182a06b831a9 where we now silently fail to force alignment of a base object. The fix is to look at the dr_info of the group leader to be consistent with alignment analysis. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2021-10-28 Richard Biener PR tree-optimization/102949 * tree-vect-stmts.c (ensure_base_align): Look at the dr_info of a group leader and assert we are looking at one with analyzed alignment. --- gcc/tree-vect-stmts.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-stmts.c b/gcc/tree-vect-stmts.c index bf07e7a9495..03cc7267cf8 100644 --- a/gcc/tree-vect-stmts.c +++ b/gcc/tree-vect-stmts.c @@ -6338,8 +6338,12 @@ vectorizable_operation (vec_info *vinfo, static void ensure_base_align (dr_vec_info *dr_info) { - if (dr_info->misalignment == DR_MISALIGNMENT_UNINITIALIZED) - return; + /* Alignment is only analyzed for the first element of a DR group, + use that to look at base alignment we need to enforce. */ + if (STMT_VINFO_GROUPED_ACCESS (dr_info->stmt)) + dr_info = STMT_VINFO_DR_INFO (DR_GROUP_FIRST_ELEMENT (dr_info->stmt)); + + gcc_assert (dr_info->misalignment != DR_MISALIGNMENT_UNINITIALIZED); if (dr_info->base_misaligned) {