Bug ID: 77952
           Summary: c++11 and gcc: internal compiler error: in
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot
          Reporter: igor at chub dot in
  Target Milestone: ---

I have the following code:

typedef int  __v8si __attribute__ ((__vector_size__ (32)));

class T
   __v8si v;

   T(int p ):v(__extension__ __v8si{p,p,p,p,p,p,p,p}){}

   T(__v8si p):v(p){}

   T operator * ( T  b ) const
      return __builtin_ia32_pmulld256( v , b.v ) ;

void h(int *);

void h(int *)

void h(int *)
 const T a(1);
 const T b(2);
 const T c (a * b);

int main()
  return 0;

If I try to compile it, I have the following error:

$ gcc test.cpp -std=c++11

test.cpp: In member function 'T T::operator*(T) const':
test.cpp:17:48: internal compiler error: in convert_move, at expr.c:315
       return __builtin_ia32_pmulld256( v , b.v ) ;
Please submit a full bug report,
with preprocessed source if appropriate.
See <> for instructions.

I have tried to compile it with various gcc versions: 4.9.2, 5.3 and several
other versions.

Have you any ideas why it happens, and how could I solve the problem?

gcc test.cpp -std=c++11 -mavx2 works.

gcc test.cpp -std=c++11 -O1 works.

but I want to compile the code with -O0

Reply via email to