c++/9381: stdcall attribute ignored in member function pointer type
Tue Jan 21 05:00:00 GMT 2003
>Synopsis: stdcall attribute ignored in member function pointer type
>Arrival-Date: Tue Jan 21 04:56:00 UTC 2003
>Originator: Ulrich Drepper
>Release: gcc 3.2.1, current CVS trunk
The attached file is miscompiled since the stdcall attribute is ignored in the fp type definition. The result it that in the function bar the parameters are popped from the stack even though they have already been removed by the called fucntion (f1 in this case).
gcc -c e.cc -O2 -fomit-frame-pointer -mpreferred-stack-boundary=2
Look in the code generated for bar, there should be no popping for the pushed parameters. In my case I get
28: ff 74 24 08 pushl 0x8(%esp,1)
2c: 50 push %eax
2d: ff d2 call *%edx
2f: 5a pop %edx
30: 59 pop %ecx
31: 5b pop %ebx
32: c3 ret
The pop %ebx is OK (it's a saved register) but the other two pops are wrong.
Content-Type: application/octet-stream; name="e.cc"
Content-Disposition: attachment; filename="e.cc"
More information about the Gcc-bugs