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

--- Comment #8 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-03 14:53:52 
UTC ---
(In reply to comment #7)
> typedef float __attribute__( ( vector_size( 4*sizeof(float) ) ) ) V4;
> constexpr V4 build(float x,float y, float z) { return (V4){x,y,z,0};}
> constexpr V4 x = build(1,0,0);
> 
> produces
> 
> c++ -std=c++11 -Ofast -c ceVec.cc 
> ceVec.cc:3:29: error: ‘(const V4)V4{1.0e+0f, 0.0f, 0.0f, 0.0f}’ is not a
> constant expression
>  constexpr V4 x = build(1,0,0);

cxx_eval_bare_aggregate returns build_constructor(...). Adding:

if (TREE_CODE (TREE_TYPE (t)) == VECTOR_TYPE)
  t = fold (t);

might help.

Reply via email to