re PR c/6290 (ICE compiling altivec code with 3.1)

PR c/6290
	* config/rs6000/rs6000.c (easy_vector_constant): Return 1 if the
	CONST_VECTOR is { 0, ... 0 }.

	* gcc.dg/altivec-5.c: New test.

From-SVN: r52340
This commit is contained in:
Jakub Jelinek 2002-04-16 00:39:10 +02:00 committed by Jakub Jelinek
parent a6bea8cee1
commit 98ef3137bf
4 changed files with 36 additions and 8 deletions

View file

@ -1,3 +1,9 @@
2002-04-16 Jakub Jelinek <jakub@redhat.com>
PR c/6290
* config/rs6000/rs6000.c (easy_vector_constant): Return 1 if the
CONST_VECTOR is { 0, ... 0 }.
2002-04-15 Loren J. Rittle <ljrittle@acm.org>
* doc/install.texi (Installing GCC: Configuration): Clarify

View file

@ -1219,18 +1219,24 @@ easy_vector_constant (op)
with CONST0_RTX for the current mode, but let's be safe
instead. */
if (GET_CODE (elt) == CONST_INT && INTVAL (elt) != 0)
return 0;
if (GET_CODE (elt) == CONST_DOUBLE
&& (CONST_DOUBLE_LOW (elt) != 0
|| CONST_DOUBLE_HIGH (elt) != 0))
return 0;
switch (GET_CODE (elt))
{
case CONST_INT:
if (INTVAL (elt) != 0)
return 0;
break;
case CONST_DOUBLE:
if (CONST_DOUBLE_LOW (elt) != 0 || CONST_DOUBLE_HIGH (elt) != 0)
return 0;
break;
default:
return 0;
}
}
/* We could probably generate a few other constants trivially, but
gcc doesn't generate them yet. FIXME later. */
return 0;
return 1;
}
/* Return 1 if the operand is the constant 0. This works for scalars

View file

@ -1,3 +1,7 @@
2002-04-16 Jakub Jelinek <jakub@redhat.com>
* gcc.dg/altivec-5.c: New test.
2002-04-15 Mark Mitchell <mark@codesourcery.com>
* testsuite/lib/chill.exp: Remove.

View file

@ -0,0 +1,12 @@
/* { dg-do compile { target powerpc-*-* } } */
/* { dg-options "-maltivec -O2" } */
#define vector __attribute__((vector_size(16)))
void foo (const unsigned long x,
vector signed int a, vector signed int b)
{
unsigned char d[64];
__builtin_altivec_stvewx (b, 0, d);
}