Like PR 33790, dse.c could handle the case mentioned in there. The current
issue is that it does:
if (GET_MODE_CLASS (read_mode) != GET_MODE_CLASS (store_mode))
return false;
And the clases are different, one is the vector float class (V4SF) and the
other is the vector integer class (V4SI) (or just integer class [TI], spu).
Testcase where an extra store/load exists:
#define vector __attribute__((__vector_size__(16) ))
typedef vector float vec_float4;
typedef struct {
vec_float4 data;
} VecFloat4;
typedef struct {
vec_float4 a;
vec_float4 b;
} VecFloat4x2;
VecFloat4 test1(VecFloat4 a, VecFloat4 b)
{
a.data = a.data+b.data;
return a;
}
VecFloat4x2 test2(VecFloat4x2 data)
{
data.a = data.a+data.a;
data.b = data.b+data.b;
return data;
}
--
Summary: replace_read in dse.c could handle cases where
GET_MODE_CLASS (read_mode) != GET_MODE_CLASS
(store_mode) (and the size is the same)
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: missed-optimization
Severity: enhancement
Priority: P3
Component: rtl-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pinskia at gcc dot gnu dot org
GCC target triplet: spu-elf, powerpc64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33927