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] Fix PR68306
Date: Thu, 12 Nov 2015 12:39:00 -0000	[thread overview]
Message-ID: <alpine.LSU.2.11.1511121338230.4884@t29.fhfr.qr> (raw)


The following fixes PR68306, an ordering issue with my last BB
vectorization patch.  Fixed by removing that ordering requirement.

Bootstrapped and tested on x86_64-unknown-linux-gnu.

Richard.

2015-11-12  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/68306
	* tree-vect-data-refs.c (verify_data_ref_alignment): Remove
	relevant and vectorizable checks here.
	(vect_verify_datarefs_alignment): Add relevant check here.

	* gcc.dg/pr68306.c: New testcase.

Index: gcc/tree-vect-data-refs.c
===================================================================
*** gcc/tree-vect-data-refs.c	(revision 230216)
--- gcc/tree-vect-data-refs.c	(working copy)
*************** verify_data_ref_alignment (data_referenc
*** 909,922 ****
    gimple *stmt = DR_STMT (dr);
    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
  
!   if (!STMT_VINFO_RELEVANT_P (stmt_info))
!     return true;
! 
!   /* For interleaving, only the alignment of the first access matters. 
!      Skip statements marked as not vectorizable.  */
!   if ((STMT_VINFO_GROUPED_ACCESS (stmt_info)
!        && GROUP_FIRST_ELEMENT (stmt_info) != stmt)
!       || !STMT_VINFO_VECTORIZABLE (stmt_info))
      return true;
  
    /* Strided accesses perform only component accesses, alignment is
--- 889,897 ----
    gimple *stmt = DR_STMT (dr);
    stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
  
!   /* For interleaving, only the alignment of the first access matters.   */
!   if (STMT_VINFO_GROUPED_ACCESS (stmt_info)
!       && GROUP_FIRST_ELEMENT (stmt_info) != stmt)
      return true;
  
    /* Strided accesses perform only component accesses, alignment is
*************** vect_verify_datarefs_alignment (loop_vec
*** 965,972 ****
    unsigned int i;
  
    FOR_EACH_VEC_ELT (datarefs, i, dr)
!     if (! verify_data_ref_alignment (dr))
!       return false;
  
    return true;
  }
--- 940,954 ----
    unsigned int i;
  
    FOR_EACH_VEC_ELT (datarefs, i, dr)
!     {
!       gimple *stmt = DR_STMT (dr);
!       stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
! 
!       if (!STMT_VINFO_RELEVANT_P (stmt_info))
! 	continue;
!       if (! verify_data_ref_alignment (dr))
! 	return false;
!     }
  
    return true;
  }
Index: gcc/testsuite/gcc.dg/pr68306.c
===================================================================
*** gcc/testsuite/gcc.dg/pr68306.c	(revision 0)
--- gcc/testsuite/gcc.dg/pr68306.c	(working copy)
***************
*** 0 ****
--- 1,10 ----
+ /* { dg-do compile } */
+ /* { dg-options "-O3" } */
+ 
+ enum powerpc_pmc_type { PPC_PMC_IBM };
+ struct {
+     unsigned num_pmcs;
+     enum powerpc_pmc_type pmc_type;
+ } a;
+ enum powerpc_pmc_type b;
+ void fn1() { a.num_pmcs = a.pmc_type = b; }

             reply	other threads:[~2015-11-12 12:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12 12:39 Richard Biener [this message]
2015-11-13 12:01 Richard Biener
2015-11-13 13:15 Uros Bizjak
2015-11-13 18:41 ` Uros Bizjak

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=alpine.LSU.2.11.1511121338230.4884@t29.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).