public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] tree-optimization/102949 - fix base object alignment
Date: Thu, 28 Oct 2021 11:02:13 +0200 (CEST)	[thread overview]
Message-ID: <n5p6q3r0-5r5p-6732-rrrs-2pq2qs4n6n82@fhfr.qr> (raw)

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  <rguenther@suse.de>

	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)
     {
-- 
2.31.1

                 reply	other threads:[~2021-10-28  9:02 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=n5p6q3r0-5r5p-6732-rrrs-2pq2qs4n6n82@fhfr.qr \
    --to=rguenther@suse.de \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).