------- Comment #2 from ubizjak at gmail dot com  2007-04-26 11:20 -------
This bug is due to my commit:

http://gcc.gnu.org/ml/gcc-cvs/2007-04/msg00657.html

This patch introduces "vec_unpacks_hi_v4sf" and "vec_unpacks_lo_v4sf" to sse.md
an these patterns trigger generic vectorizer problem (related to multiple data
types in the loop having VEC_UNPAC_HI/LO and not related to convesions at all)
in alignment handling.

Polyhedron crashes in:

Dump of assembler code from 0x804def2 to 0x804dff2:
>>  0x0804def2 <invima+594>:        movapd %xmm1,(%eax)
    0x0804def6 <invima+598>:        cvtps2pd 0xffffff48(%ebp),%xmm0
    0x0804defd <invima+605>:        movapd %xmm0,0x10(%eax)
    0x0804df02 <invima+610>:        add    $0x20,%eax
    0x0804df05 <invima+613>:        cmp    %edi,%ebx

Dorit has confirmed the problem and she is already testing a fix.

The C testcase that crashes (you need -O2 -msse2 -ftree-vectorize [-m32]) to
trigger the problem, as "z" needs to be aligned to 8 bytes:

--cut here--
float x[256];

void foo(void)
{
 double *z = malloc (sizeof(double) * 256);

 int i;
 for (i=0; i<256; ++i)
   z[i] = x[i] + 1.0f;
}


int main()
{
 int i;

 for (i = 0; i < 256; i++)
   x[i] = (float) i;

 foo();

 return 0;
}
--cut here--

If an urgent fix is needed, then simply rename "vec_unpacks_hi_v4sf" to
"*vec_unpacks_hi_v4sf".


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dorit at il dot ibm dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31699

Reply via email to