OSDN Git Service

PR tree-optimization/33597
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 Sep 2007 12:45:32 +0000 (12:45 +0000)
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 Sep 2007 12:45:32 +0000 (12:45 +0000)
        * tree-vect-analyze.c (vect_build_slp_tree): Check if optab handler
        for LSHIFT_EXPR and RSHIFT_EXPR is available for vec_mode.

testsuite/ChangeLog:

        PR tree-optimization/33597
        * gcc.dg/vect/pr33597.c: New testcase.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128891 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/pr33597.c [new file with mode: 0644]
gcc/tree-vect-analyze.c

index a80d07f..ea66227 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-30  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/33597
+       * tree-vect-analyze.c (vect_build_slp_tree): Check if optab handler
+       for LSHIFT_EXPR and RSHIFT_EXPR is available for vec_mode.
+
 2007-09-28  Uros Bizjak  <ubizjak@gmail.com>
 
        * config/i386/i386.c (ix86_expand_move): Use can_create_pseudo_p ()
index 1964b5c..ef5e04a 100644 (file)
@@ -1,3 +1,8 @@
+2007-09-30  Uros Bizjak  <ubizjak@gmail.com>
+
+       PR tree-optimization/33597
+       * gcc.dg/vect/pr33597.c: New testcase.
+
 2007-09-29  Uros Bizjak  <ubizjak@gmail.com>
 
        * gcc.target/i386/sse5-convert.c: Fix target selector and rename to...
diff --git a/gcc/testsuite/gcc.dg/vect/pr33597.c b/gcc/testsuite/gcc.dg/vect/pr33597.c
new file mode 100644 (file)
index 0000000..7fdcde0
--- /dev/null
@@ -0,0 +1,24 @@
+/* { dg-do compile } */
+
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+
+void
+rgb15to24_C (const uint8_t * src, uint8_t * dst, long src_size)
+{
+  const uint16_t *end;
+  const uint16_t *s = (uint16_t *)src;
+  uint8_t *d = (uint8_t *)dst;
+
+  end = s + src_size/2;
+  while (s < end)
+    {
+      uint16_t bgr = *s++;
+
+      *d++ = (bgr&0x1F)<<3;
+      *d++ = (bgr&0x3E0)>>2;
+      *d++ = (bgr&0x7C00)>>7;
+    }
+}
+
+/* { dg-final { cleanup-tree-dump "vect" } } */
index 86ca6b6..92ef5be 100644 (file)
@@ -2696,6 +2696,13 @@ vect_build_slp_tree (loop_vec_info loop_vinfo, slp_tree *node,
                  return false;
                }
              icode = (int) optab->handlers[(int) vec_mode].insn_code;
+             if (icode == CODE_FOR_nothing)
+               {
+                 if (vect_print_dump_info (REPORT_SLP))
+                   fprintf (vect_dump,
+                            "Build SLP failed: op not supported by target.");
+                 return false;
+               }
              optab_op2_mode = insn_data[icode].operand[2].mode;
              if (!VECTOR_MODE_P (optab_op2_mode))
                {