public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Guenther <rguenther@suse.de>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH][4.5] Fix backport of PR44284 fix
Date: Fri, 09 Jul 2010 13:49:00 -0000	[thread overview]
Message-ID: <alpine.LNX.2.00.1007091547070.1429@zhemvz.fhfr.qr> (raw)


This fixes up the backport which was done to avoid regressing with
the fix for PR44828.  The issue is that vector types on the branch
are a lot messier, thus the following makes everything 100% explicit.

Bootstrap and regtest on x86_64-unknown-linux-gnu in progress.  I
verified it fixes the new ICEs on IA64 seen here:
http://gcc.gnu.org/ml/gcc-regression/2010-07/msg00129.html

Richard.

2010-07-09  Richard Guenther  <rguenther@suse.de>

	* tree-vect-stmts.c (vectorizable_assignment): Fixup backport
	of the fix for PR44284.

Index: gcc/tree-vect-stmts.c
===================================================================
*** gcc/tree-vect-stmts.c	(revision 161997)
--- gcc/tree-vect-stmts.c	(working copy)
*************** vectorizable_assignment (gimple stmt, gi
*** 1814,1820 ****
    gimple new_stmt = NULL;
    stmt_vec_info prev_stmt_info = NULL;
    enum tree_code code;
!   tree vectype_in;
  
    /* Multiple types in SLP are handled by creating the appropriate number of
       vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
--- 1814,1820 ----
    gimple new_stmt = NULL;
    stmt_vec_info prev_stmt_info = NULL;
    enum tree_code code;
!   tree vectype_in, vectype_out;
  
    /* Multiple types in SLP are handled by creating the appropriate number of
       vectorized stmts for each SLP node. Hence, NCOPIES is always 1 in
*************** vectorizable_assignment (gimple stmt, gi
*** 1858,1867 ****
    /* We can handle NOP_EXPR conversions that do not change the number
       of elements or the vector size.  */
    vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op));
    if (CONVERT_EXPR_CODE_P (code)
        && (!vectype_in
! 	  || TYPE_VECTOR_SUBPARTS (vectype_in) != nunits
! 	  || (GET_MODE_SIZE (TYPE_MODE (vectype))
  	      != GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
      return false;
  
--- 1858,1870 ----
    /* We can handle NOP_EXPR conversions that do not change the number
       of elements or the vector size.  */
    vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op));
+   vectype_out
+     = get_vectype_for_scalar_type (TREE_TYPE (gimple_assign_lhs (stmt)));
    if (CONVERT_EXPR_CODE_P (code)
        && (!vectype_in
! 	  || (TYPE_VECTOR_SUBPARTS (vectype_out)
! 	      != TYPE_VECTOR_SUBPARTS (vectype_in))
! 	  || (GET_MODE_SIZE (TYPE_MODE (vectype_out))
  	      != GET_MODE_SIZE (TYPE_MODE (vectype_in)))))
      return false;
  
*************** vectorizable_assignment (gimple stmt, gi
*** 1894,1900 ****
        for (i = 0; VEC_iterate (tree, vec_oprnds, i, vop); i++)
         {
  	 if (CONVERT_EXPR_CODE_P (code))
! 	   vop = build1 (VIEW_CONVERT_EXPR, vectype, vop);
           new_stmt = gimple_build_assign (vec_dest, vop);
           new_temp = make_ssa_name (vec_dest, new_stmt);
           gimple_assign_set_lhs (new_stmt, new_temp);
--- 1897,1903 ----
        for (i = 0; VEC_iterate (tree, vec_oprnds, i, vop); i++)
         {
  	 if (CONVERT_EXPR_CODE_P (code))
! 	   vop = build1 (VIEW_CONVERT_EXPR, vectype_out, vop);
           new_stmt = gimple_build_assign (vec_dest, vop);
           new_temp = make_ssa_name (vec_dest, new_stmt);
           gimple_assign_set_lhs (new_stmt, new_temp);

                 reply	other threads:[~2010-07-09 13:49 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=alpine.LNX.2.00.1007091547070.1429@zhemvz.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).