gcc produces broken function entry code when building code with incomplete prototypes, and -mregparm=3. The following test case illustrates the problem ... extern int printf (const char *, ...) __attribute__ ((regparm(0))); static int test(); int main(int argc, char **argv) { test(0,1,2,3,4,5,6,7); } static int test(int a, int b, int c, int d, int e, int f, int g, int h) { if (a != 0 || b != 1 || c != 2) { printf("Wrong: Got (%p, %p, %p, %p, %p, %p, %p, %p)", a, b, c, d, e, f, g, h); } return 1; } When built with gcc -mregparm=3, and run, this produces: Wrong: Got (0x1, 0xbfc96430, 0xbfc96410, (nil), 0x1, 0x2, 0x3, 0x4)
*** This bug has been marked as a duplicate of 36015 ***