re PR tree-optimization/32243 (ICE in vectorizable_type_promotion, at tree-vect-transform.c:2890)

PR tree-optimization/32243
	* tree-vect-transform.c (vectorizable_type_promotion): Move check
	for ncopies after ratio check between nunits_out and nunits_in.
	(vectorizable_type_demotion): Remove single-use variable "scalar_type".

testsuite/ChangeLog:
	
	PR tree-optimization/32243
	* gcc.dg/vect/vect.exp: Add support for -O3 tests.  Reset default
	flags for -Os tests.
	* gcc.dg/vect/03-vect-pr32243.c: New test.

From-SVN: r125567
This commit is contained in:
Uros Bizjak 2007-06-08 11:06:46 +02:00 committed by Uros Bizjak
parent 0d2665809f
commit 459e691ae8
5 changed files with 52 additions and 5 deletions

View File

@ -1,3 +1,10 @@
2007-06-08 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/32243
* tree-vect-transform.c (vectorizable_type_promotion): Move check
for ncopies after ratio check between nunits_out and nunits_in.
(vectorizable_type_demotion): Remove single-use variable "scalar_type".
2007-06-08 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/32224

View File

@ -1,3 +1,10 @@
2007-06-08 Uros Bizjak <ubizjak@gmail.com>
PR tree-optimization/32243
* gcc.dg/vect/vect.exp: Add support for -O3 tests. Reset default
flags for -Os tests.
* gcc.dg/vect/03-vect-pr32243.c: New test.
2007-06-08 Dorit Nuzman <dorit@il.ibm.com>
PR tree-optimization/32224

View File

@ -0,0 +1,27 @@
/* { dg-do compile } */
typedef struct __GLcontextRec GLcontext;
struct gl_renderbuffer
{
struct gl_renderbuffer *Wrapped;
void (*PutValues) (GLcontext * ctx, struct gl_renderbuffer * rb,
int count, const int x[], const int y[],
const void *values, const char *mask);
};
void
put_mono_values_s8 (GLcontext * ctx, struct gl_renderbuffer *s8rb,
int count, const int x[], const int y[],
const void *value, const char *mask)
{
struct gl_renderbuffer *dsrb = s8rb->Wrapped;
int temp[4096], i;
const char val = *((char *) value);
for (i = 0; i < count; i++)
if (!mask || mask[i])
temp[i] = (temp[i] & 0xffffff) | val;
dsrb->PutValues (ctx, dsrb, count, x, y, temp, mask);
}
/* { dg-final { cleanup-tree-dump "vect" } } */

View File

@ -175,10 +175,17 @@ dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/no-tree-dom-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# With -Os
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-Os"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/Os-vect-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# With -O3
set DEFAULT_VECTCFLAGS $SAVED_DEFAULT_VECTCFLAGS
lappend DEFAULT_VECTCFLAGS "-O3"
dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/O3-vect-*.\[cS\]]] \
"" $DEFAULT_VECTCFLAGS
# Clean up.
set dg-do-what-default ${save-dg-do-what-default}

View File

@ -2708,7 +2708,6 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
int j;
tree expr;
tree vectype_in;
tree scalar_type;
if (!STMT_VINFO_RELEVANT_P (stmt_info))
return false;
@ -2741,8 +2740,7 @@ vectorizable_type_demotion (tree stmt, block_stmt_iterator *bsi,
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
scalar_type = TREE_TYPE (scalar_dest);
vectype_out = get_vectype_for_scalar_type (scalar_type);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
nunits_out = TYPE_VECTOR_SUBPARTS (vectype_out);
if (nunits_in != nunits_out / 2) /* FORNOW */
return false;
@ -2887,8 +2885,6 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
op0 = TREE_OPERAND (operation, 0);
vectype_in = get_vectype_for_scalar_type (TREE_TYPE (op0));
nunits_in = TYPE_VECTOR_SUBPARTS (vectype_in);
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
scalar_dest = GIMPLE_STMT_OPERAND (stmt, 0);
vectype_out = get_vectype_for_scalar_type (TREE_TYPE (scalar_dest));
@ -2896,6 +2892,9 @@ vectorizable_type_promotion (tree stmt, block_stmt_iterator *bsi,
if (nunits_out != nunits_in / 2) /* FORNOW */
return false;
ncopies = LOOP_VINFO_VECT_FACTOR (loop_vinfo) / nunits_in;
gcc_assert (ncopies >= 1);
if (! ((INTEGRAL_TYPE_P (TREE_TYPE (scalar_dest))
&& INTEGRAL_TYPE_P (TREE_TYPE (op0)))
|| (SCALAR_FLOAT_TYPE_P (TREE_TYPE (scalar_dest))