Patchwork Fix PR tree-optimization/46126

login
register
mail settings
Submitter Ira Rosen
Date Oct. 22, 2010, 12:49 p.m.
Message ID <OF8AF4CA10.217000E1-ONC22577C4.00444A06-C22577C4.004669DE@il.ibm.com>
Download mbox | patch
Permalink /patch/68841/
State New
Headers show

Comments

Ira Rosen - Oct. 22, 2010, 12:49 p.m.
Hi,

In basic block vectorization SLP node should be passed to vectorizable_*
functions during the analysis. In the previous patch that added
vectorizable_shift (), I forgot to do that.

Bootstrapped and tested on x86_64-suse-linux.
Committed.

Ira


ChangeLog:

	PR tree-optimization/46126
	* tree-vect-stmts.c (vect_analyze_stmt): Pass NODE to
	vectorizable_shift in case of basic block vectorization.

testsuite/ChangeLog:

	PR tree-optimization/46126
	* gcc.dg/vect/pr46126.c: New.

Patch

Index: testsuite/gcc.dg/vect/pr46126.c
===================================================================
--- testsuite/gcc.dg/vect/pr46126.c     (revision 0)
+++ testsuite/gcc.dg/vect/pr46126.c     (revision 0)
@@ -0,0 +1,23 @@ 
+/* { dg-do compile } */
+
+typedef struct TypHeader {
+     struct TypHeader * * ptr;
+     unsigned char type;
+ } * TypHandle;
+ extern TypHandle (* EvTab[81]) ( TypHandle hd );
+ TypHandle FunApplyRel ( TypHandle hdCall )
+ {
+     TypHandle hdApp;
+     TypHandle * ptApp;
+     long lp;
+     long lc;
+     hdApp = ((long)(((TypHandle*)((hdCall)->ptr))[1])&1 ?
+(((TypHandle*)((hdCall)->ptr))[1]) : (*
+EvTab[(((long)(((TypHandle*)((hdCall)->ptr))[1]) & 1) ? 1 :
+((((TypHandle*)((hdCall)->ptr))[1])->type))])((((TypHandle*)((hdCall)->
ptr))[1])));
+     ptApp = ((TypHandle*)((hdApp)->ptr));
+     ptApp[1] = ((TypHandle) (((long)(lp) << 2) + 1));
+     ptApp[2] = ((TypHandle) (((long)(lc) << 2) + 1));
+ }
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
Index: tree-vect-stmts.c
===================================================================
--- tree-vect-stmts.c   (revision 165823)
+++ tree-vect-stmts.c   (working copy)
@@ -4663,7 +4663,7 @@  vect_analyze_stmt (gimple stmt, bool *ne
     else
       {
         if (bb_vinfo)
-          ok = (vectorizable_shift (stmt, NULL, NULL, NULL)
+          ok = (vectorizable_shift (stmt, NULL, NULL, node)
                 || vectorizable_operation (stmt, NULL, NULL, node)
                 || vectorizable_assignment (stmt, NULL, NULL, node)
                 || vectorizable_load (stmt, NULL, NULL, node, NULL)