https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82242
Alexander Monakov <amonakov at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2017-09-20 CC| |amonakov at gcc dot gnu.org, | |vmakarov at gcc dot gnu.org Ever confirmed|0 |1 --- Comment #3 from Alexander Monakov <amonakov at gcc dot gnu.org> --- (Marc, for vectorization -fassociative-math would be required) I think it's due to handling of possibly-throwing insns in register allocation: allocno for the accumulator is considered to conflict with all SSE registers, but the throwing call is outside of the loop, and we don't want spills inside the loop. Minimal C++ testcase, needs just -O2: void c(); struct S {~S();}; double f(double *x, int n) { S s; double r = 0; for (; n; n--) r += *x++; c(); return r; } I don't understand why throwing calls are more special than normal calls for IRA, it seems values in call-clobbered registers would need to be spilled either way...