This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: __attribute__ __stdcall__ support broken in latest-egcs



  In message <199904091754.TAA31781@jet.franken.de>you write:
  > 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 experiment
  > al)"
  > (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".
  > 
I just tried this with the current gcc-2.95 CVS sources and got:


foo:
        pushl %ebp
        movl %esp,%ebp
        movl 8(%ebp),%edx
        incl %edx
        movl %edx,%eax
        jmp .L2
        .p2align 4,,7
.L2:
        movl %ebp,%esp
        popl %ebp
        ret $4


Which appears correct.  I believe one of rth's patches fixed this bug.

jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]