tree-vect-transform.c (vect_create_epilog_for_reduction): Set BIT_FIELD_REF_UNSIGNED...
authorDorit Nuzman <dorit@il.ibm.com>
Tue, 9 Aug 2005 15:58:59 +0000 (15:58 +0000)
committerDorit Nuzman <dorit@gcc.gnu.org>
Tue, 9 Aug 2005 15:58:59 +0000 (15:58 +0000)
* tree-vect-transform.c (vect_create_epilog_for_reduction): Set
        BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs.

From-SVN: r102913

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/vect-reduc-1char.c
gcc/tree-vect-transform.c

index 8a271ba1bd3bb22b3c0ec296a8c1ac127d902a7d..da09bc4495234166701f1adce47a62eda91d528b 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-09  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * tree-vect-transform.c (vect_create_epilog_for_reduction): Set 
+       BIT_FIELD_REF_UNSIGNED for newly created BIT_FIELD_REFs.
+
 2005-08-09  Richard Guenther  <rguenther@suse.de>
 
        * c-common.c (builtin_function_2): Remove.
index 42af1a20fad0513a5efdd995fd545c9390561acd..ccd238c8245ccce18d41a913919bdaef35e6c492 100644 (file)
@@ -1,3 +1,8 @@
+2005-08-09  Dorit Nuzman  <dorit@il.ibm.com>
+
+       * gcc.dg/vect/vect-reduc-1char.c: Reverse last change - change
+       input data back to what it was originally.
+
 2005-08-09  Andrew Pinski  <pinskia@physics.uc.edu>
 
        * objc.dg/try-catch-8.m: Enable for all targets.
index e05f2a116acb0ace2edb3d48155a51efaa149efc..418687dd23bfaec0ddb77b8a8e2969ad1ee9522a 100644 (file)
@@ -4,13 +4,13 @@
 #include "tree-vect.h"
 
 #define N 16
-#define DIFF 122
+#define DIFF 242
 
 void
 main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
 {
   int i;
-  unsigned char ub[N] = {1,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30};
+  unsigned char ub[N] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
   unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
   unsigned char udiff = 2;
   unsigned char umax = x;
index 9dab8bcda4bff77455f0fdc6cebf2c31d4668b9e..1923cbce828193bc5e466ffed85fe1680d11e49a 100644 (file)
@@ -1021,9 +1021,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
             && (integer_zerop (scalar_initial_def) 
                 || real_zerop (scalar_initial_def)))
            {
-             epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest,
-                                build3 (BIT_FIELD_REF, scalar_type,
-                                       vec_temp, bitsize, bitsize_zero_node));
+             tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
+                                bitsize_zero_node);
+
+             BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
+             epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, 
+                                   rhs);
               new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
               TREE_OPERAND (epilog_stmt, 0) = new_temp;
               bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
@@ -1043,10 +1046,12 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
               bit_offset += element_bitsize)
            { 
              tree bitpos = bitsize_int (bit_offset);
-
+             tree rhs = build3 (BIT_FIELD_REF, scalar_type, vec_temp, bitsize,
+                                bitpos);
+               
+             BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
              epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest,
-                               build3 (BIT_FIELD_REF, scalar_type,
-                                       vec_temp, bitsize, bitpos));
+                                   rhs);       
              new_name = make_ssa_name (new_scalar_dest, epilog_stmt);
              TREE_OPERAND (epilog_stmt, 0) = new_name;
              bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);
@@ -1074,6 +1079,8 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
   
   if (extract_scalar_result)
     {
+      tree rhs;
+
       if (vect_print_dump_info (REPORT_DETAILS))
        fprintf (vect_dump, "extract scalar result");
 
@@ -1085,9 +1092,9 @@ vect_create_epilog_for_reduction (tree vect_def, tree stmt, tree reduction_op,
       else
        bitpos = bitsize_zero_node;
 
-      epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest,
-                    build3 (BIT_FIELD_REF, scalar_type,
-                            new_temp, bitsize, bitpos));
+      rhs = build3 (BIT_FIELD_REF, scalar_type, new_temp, bitsize, bitpos);
+      BIT_FIELD_REF_UNSIGNED (rhs) = TYPE_UNSIGNED (scalar_type);
+      epilog_stmt = build2 (MODIFY_EXPR, scalar_type, new_scalar_dest, rhs);
       new_temp = make_ssa_name (new_scalar_dest, epilog_stmt);
       TREE_OPERAND (epilog_stmt, 0) = new_temp; 
       bsi_insert_after (&exit_bsi, epilog_stmt, BSI_NEW_STMT);