__attribute__ __stdcall__ support broken in latest-egcs
Marcus Meissner
marcus@jet.franken.de
Fri Apr 9 11:58:00 GMT 1999
Hi egcs-bugs, hi John
Following code snippet
------------------------------------------------
int __attribute__((__stdcall__)) foo(int a) {
return a+1;
}
-----------------------------------------------
compiled with "gcc version egcs-2.93.17 19990409 (gcc2 ss-980929 experimental)"
(no optimization options) results in following wrong assembler code:
00000000 <foo>:
0: 55 pushl %ebp
1: 89 e5 movl %esp,%ebp
3: 83 ec 08 subl $0x8,%esp
6: 8b 45 08 movl 0x8(%ebp),%eax
9: 40 incl %eax
a: 89 ec movl %ebp,%esp
c: 5d popl %ebp
d: c2 10 00 ret $0x10
The ret should be "ret 0x4", not "ret 0x10".
Reading the ChangeLog, it seems this problem has been introduced by the
following patch:
|Thu Feb 11 00:08:17 1999 John Wehle (john@feith.com)
|...
| * i386.h (LOCAL_ALIGNMENT): Define.
| * function.c (assign_stack_local, assign_outer_stack_local): Use it.
| (assign_stack_temp_for_type): New function based on assign_stack_temp.
| (assign_stack_temp): Call it.
| (assign_temp): Use assign_stack_temp_for_type, not assign_stack_temp.
| * stmt.c: Use assign_temp, not assign_stack_temp.
| * tm.texi: Document LOCAL_ALIGNMENT.
Ciao, Marcus
More information about the Gcc-bugs
mailing list