This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix 64-bit vectorization


Seems this is affecting quite a few 64-bit targets, causing most
of the vectorization tests to crash.  I'm not sure if we didn't
expect to see conversions here, or if it was thought that the
STRIP_NOPS should take care of all of them, but this seems to do
the trick for the moment.

Tested on x86_64-linux.


r~


        * tree-vectorizer.c (vect_analyze_offset_expr): Strip conversions
        that don't narrow the value.  Fail for other conversions.

Index: tree-vectorizer.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-vectorizer.c,v
retrieving revision 2.55
diff -c -p -d -r2.55 tree-vectorizer.c
*** tree-vectorizer.c	29 Dec 2004 13:54:29 -0000	2.55
--- tree-vectorizer.c	2 Jan 2005 08:34:11 -0000
*************** vect_analyze_offset_expr (tree expr, 
*** 1390,1396 ****
    enum tree_code code;
    tree init, evolution, def_stmt;
  
!   STRIP_NOPS (expr);
    
    *step = NULL_TREE;
    *misalign = NULL_TREE;
--- 1390,1411 ----
    enum tree_code code;
    tree init, evolution, def_stmt;
  
!   /* Strip conversions that don't narrow the mode.  */
!   while (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
!     {
!       tree to, ti;
! 
!       to = TREE_TYPE (expr);
!       oprnd0 = TREE_OPERAND (expr, 0);
!       ti = TREE_TYPE (oprnd0);
! 
!       if (!INTEGRAL_TYPE_P (to) || !INTEGRAL_TYPE_P (ti))
! 	return false;
!       if (GET_MODE_SIZE (TYPE_MODE (to)) < GET_MODE_SIZE (TYPE_MODE (ti)))
! 	return false;
! 
!       expr = oprnd0;
!     }
    
    *step = NULL_TREE;
    *misalign = NULL_TREE;


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]