https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102622
--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Here is a slightly more reduced testcase (without the reasonable values): static inline const unsigned &max1(const unsigned &t, const unsigned &t1) { return t > t1 ? t : t1; } extern int var_20, var_22; extern short arr_32[]; extern char arr_45[]; void test(int a, unsigned b, const long long &c) __attribute__((noipa)); void test(int a, unsigned b, const long long &c) { for (short d = 0; d < 13; d++) { for (int e = 0; e < a; e += 3) var_20 = 0; if (max1(b, unsigned((short)b))) { arr_32[d] = 0; var_22 = c; } for (unsigned f = 0; f < 69; f += 4) arr_45[f] = 0; } } int var_20 = 0; int var_22 = 0; short arr_32 [13]; char arr_45 [69]; int main() { test(-1, 1, 42); if (var_22 != 42) __builtin_abort(); return 0; }