public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH, vectorizer]: Fix PR tree-optimization/33597: ICE while compiling  libswcale from ffmpeg
@ 2007-09-30 14:04 Uros Bizjak
  2007-09-30 14:10 ` Richard Guenther
  0 siblings, 1 reply; 2+ messages in thread
From: Uros Bizjak @ 2007-09-30 14:04 UTC (permalink / raw)
  To: GCC Patches

[-- Attachment #1: Type: text/plain, Size: 588 bytes --]

Hello!

We forgot to check if optab is available in requested mode. Attached 
patch introduces this missing check.
Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu.

OK for mainline?

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.

testsuite/ChangeLog:

2007-09-30  Uros Bizjak  <ubizjak@gmail.com>

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

Uros.




[-- Attachment #2: pr33597.diff.txt --]
[-- Type: text/plain, Size: 1357 bytes --]

Index: testsuite/gcc.dg/vect/pr33597.c
===================================================================
--- testsuite/gcc.dg/vect/pr33597.c	(revision 0)
+++ testsuite/gcc.dg/vect/pr33597.c	(revision 0)
@@ -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: tree-vect-analyze.c
===================================================================
--- tree-vect-analyze.c	(revision 128890)
+++ tree-vect-analyze.c	(working copy)
@@ -2696,6 +2696,13 @@ vect_build_slp_tree (loop_vec_info loop_
 		  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))
 		{

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, vectorizer]: Fix PR tree-optimization/33597: ICE while compiling libswcale from ffmpeg
  2007-09-30 14:04 [PATCH, vectorizer]: Fix PR tree-optimization/33597: ICE while compiling libswcale from ffmpeg Uros Bizjak
@ 2007-09-30 14:10 ` Richard Guenther
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Guenther @ 2007-09-30 14:10 UTC (permalink / raw)
  To: Uros Bizjak; +Cc: GCC Patches

On 9/30/07, Uros Bizjak <ubizjak@gmail.com> wrote:
> Hello!
>
> We forgot to check if optab is available in requested mode. Attached
> patch introduces this missing check.
> Patch was bootstrapped and regression tested on x86_64-pc-linux-gnu.
>
> OK for mainline?

This is ok.

Thanks,
Richard.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-09-30 11:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-30 14:04 [PATCH, vectorizer]: Fix PR tree-optimization/33597: ICE while compiling libswcale from ffmpeg Uros Bizjak
2007-09-30 14:10 ` Richard Guenther

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).