https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119298
--- Comment #9 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Richard Biener from comment #8) > (In reply to Jan Hubicka from comment #7) [...] > > return false; > > ... > > case scalar_stmt: > > return fp ? ix86_cost->addss : COSTS_N_INSNS (1); > > we shouldn't get here, the add_stmt_cost "hook" handles operations > separately. > > > .... > > case vector_stmt: > > return ix86_vec_cost (mode, > > fp ? ix86_cost->addss : ix86_cost->sse_op); > > I'm not sure why we use addss cost in case of FP mode. So this would be > the only two places to try fixing. > > The question is for which ops we fall back here. The following might tell: > > diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc > index 4f8380c4a58..fe1beefe732 100644 > --- a/gcc/config/i386/i386.cc > +++ b/gcc/config/i386/i386.cc > @@ -25346,6 +25346,7 @@ ix86_vector_costs::add_stmt_cost (int count, > vect_cost_for_stmt kind, > stmt_cost = ix86_cost->add; > break; > default: > + gcc_unreachable (); > break; > } > } OK, it's a quite incomplete set. I would suggest to fix the fallback to use sse_op and never addss. Or avoid reducing the addss cost alltogether as a simpler thing for now.