Patchwork Fix ICE in vectorizable_store (PR tree-optimization/45047)

login
register
mail settings
Submitter Jakub Jelinek
Date July 23, 2010, 5:03 p.m.
Message ID <20100723170302.GJ18378@tyan-ft48-01.lab.bos.redhat.com>
Download mbox | patch
Permalink /patch/59825/
State New
Headers show

Comments

Jakub Jelinek - July 23, 2010, 5:03 p.m.
Hi!

Another fixup for the PR44284 backport to 4.5 branch, the test
was ICEing on s390-linux with -m31 -O3.

Fixed thusly, committed to branch.  Will commit the testcase to trunk too.

2010-07-23  Jakub Jelinek  <jakub@redhat.com>
	    Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/45047
	* tree-vect-stmts.c (vectorizable_assignment): Return false
	if vectype_out is NULL for conversion statement.

	* gcc.c-torture/compile/pr45047.c: New test.


	Jakub
Matthias Klose - July 25, 2010, 1:04 p.m.
On 23.07.2010 19:03, Jakub Jelinek wrote:
> Hi!
>
> Another fixup for the PR44284 backport to 4.5 branch, the test
> was ICEing on s390-linux with -m31 -O3.
>
> Fixed thusly, committed to branch.  Will commit the testcase to trunk too.

moved the ChangeLog entry from toplevel to the gcc directory. committed as obvious.

   Matthias

Patch

--- gcc/tree-vect-stmts.c	(revision 162467)
+++ gcc/tree-vect-stmts.c	(working copy)
@@ -1862,6 +1862,7 @@  vectorizable_assignment (gimple stmt, gi
     = get_vectype_for_scalar_type (TREE_TYPE (gimple_assign_lhs (stmt)));
   if (CONVERT_EXPR_CODE_P (code)
       && (!vectype_in
+	  || !vectype_out      
 	  || (TYPE_VECTOR_SUBPARTS (vectype_out)
 	      != TYPE_VECTOR_SUBPARTS (vectype_in))
 	  || (GET_MODE_SIZE (TYPE_MODE (vectype_out))
--- gcc/testsuite/gcc.c-torture/compile/pr45047.c	(revision 0)
+++ gcc/testsuite/gcc.c-torture/compile/pr45047.c	(revision 0)
@@ -0,0 +1,9 @@ 
+/* PR tree-optimization/45047 */
+
+void
+foo (const unsigned short *w, char *x, int y, int z)
+{
+  int i;
+  for (i = 0; i < y; i++)
+    x[i] = w[i] == z;
+}