https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69042
--- Comment #7 from amker at gcc dot gnu.org --- If I add back the candidate, ivopt can fix attached case, but it still can't handle a slightly tuned case as below: extern const int indexes[]; int bar (int code); int foo (short *data) { register int i, j; j = 0; for (i = 1; i < 64; i++) { if (data[indexes[i]]) { j++; } else { if (bar (j)) return 0; j = 0; __asm__("":::"eax","ebx","ecx","edx","esi","edi","ebp"); } } return 1; } The only difference is change bar from a function definition to a declaration. The cost computed in ivopt for pic related symbol-ref is different because of issue described at : https://gcc.gnu.org/ml/gcc/2016-02/msg00040.html