http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53094
--- Comment #9 from vincenzo Innocente <vincenzo.innocente at cern dot ch>
2012-12-03 19:15:09 UTC ---
adding it "helps"
t = build_constructor (TREE_TYPE (t), n);
+ if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
+ t = fold (t);
TREE_CONSTANT (t) = true;
unfortunately generates ICE for the class constructor at cp/tree.c:2712
struct Rot3 {
typedef float T;
typedef V4 Vec;
Vec axis[3];
constexpr Rot3( V4 ix, V4 iy, V4 iz) :
axis{ix,iy,iz}{}
constexpr Rot3(T xx, T xy, T xz, T yx, T yy, T yz, T zx, T zy, T zz) :
Rot3( (Vec){xx,xy,xz,0},
(Vec){yx,yy,yz,0},
(Vec){zx,zy,zz,0}
){}
};
constexpr Rot3 r2( (V4){0, 1 ,0,0}, (V4){0, 0, 1,0},(V4){1, 0, 0,0});
constexpr Rot3 r1( 0, 1 ,0, 0, 0, 1, 1, 0, 0);
ceVec.cc:26:46: in constexpr expansion of ‘((Rot3*)(& r1))->Rot3::Rot3(0.0,
1.0e+0, 0.0, 0.0, 0.0, 1.0e+0, 1.0e+0, 0.0, 0.0)’
ceVec.cc:21:4: in constexpr expansion of
‘((Rot3*)this)->Rot3::Rot3(Rot3::Vec{xx, xy, xz, 0.0f}, Rot3::Vec{yx, yy, yz,
0.0f}, Rot3::Vec{zx, zy, zz, 0.0f})’
ceVec.cc:26:46: internal compiler error: in cp_tree_equal, at cp/tree.c:2712
constexpr Rot3 r1( 0, 1 ,0, 0, 0, 1, 1, 0, 0);