http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46942
--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> 2010-12-14 17:13:19 UTC --- __attribute__((noinline, noclone)) unsigned long f1 (unsigned int a, int b, unsigned short c, short d, unsigned char e, signed char f) { return (unsigned long) a + b + c + d + e + f; } unsigned long l; unsigned long f2 (void) { return f1 (l + 41, l + 41, l + 41, l + 41, l + 41, l + 41) + 1; } unsigned long f3 (unsigned int a, int b, unsigned short c, short d, unsigned char e, signed char f) { return f1 (a, b, c, d, e, f); } unsigned long f4 (int a, unsigned int b, short c, unsigned short d, signed char e, unsigned char f) { return f1 (a, b, c, d, e, f); } at -O2 shows in f4 that we can't trust that the sign/zero extension is done on the caller side, at least we can't trust that it is sign/zero extended into 64-bits.