------- Comment #6 from sam at rfc1149 dot net 2007-10-27 18:32 ------- Here is a small test case for this program. Compile with -mregparm=3 (or any value greater than 0 on x86).
#include <stdio.h> typedef void (*func) (int a, ...); void f (int a, int b) { printf ("a = %d, b = %d\n", a, b); } int main () { func g = (void *) f; g (1, 2); return 0; } The execution on my machine prints: a = 134513524, b = -1078190752 instead of the expected a = 1, b = 2 obtained when using -mregparm=0. The call to "f" (through variable "g") is generated as-is: movl $2, 4(%esp) movl $1, (%esp) call f instead of using registers. -- sam at rfc1149 dot net changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |sam at rfc1149 dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12081