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]

(i386-linux native) extra stack adjusts generated


version: CVS
   host: i386
 target: native
options: -O2 -mpentiumpro -S -g

I see extra stack adjusts generated for the i386 when calling functions.
This appears to be the same problem as sh-elf?

File is layer3.i from ftp://shell14.ba.best.com/pub.t/tm2/stress-1.14.tar.gz.

...
2694:./layer3.i    ****     gainpow2[i+256] = pow((double)2.0,-0.25 * 
(double) (i+210) );
 3648 0020 8B45E4               movl    -28(%ebp), %eax
 3649 0023 05D20000             addl    $210, %eax
 3649      00
 3650 0028 50                   pushl   %eax
 3651 0029 DB0424               fildl   (%esp)
 3652 002c 58                   popl    %eax
 3653 002d 83EC08               subl    $8, %esp	<- 8 extra
 3654 0030 DC0D0000             fmull   .LC0
 3654      0000
 3655 0036 DD1C24               fstpl   (%esp)
 3656 0039 68000000             pushl   $1073741824
 3656      40
 3657 003e 6A00                 pushl   $0
 3658 0040 E8FCFFFF             call    pow
 3658      FF
 3661 0045 83C410               addl    $16, %esp
...
2697:./layer3.i    ****     ispow[i] = pow((double)i,(double)4.0/3.0);
 3678 0060 DB45E4               fildl   -28(%ebp)
 3679 0063 685555F5             pushl   $1073042773
 3679      3F
 3680 0068 68555555             pushl   $1431655765
 3680      55
 3681 006d 83EC08               subl    $8, %esp	<- 8 extra
 3682 0070 DD1C24               fstpl   (%esp)
 3683 0073 E8FCFFFF             call    pow
 3683      FF
 3684 0078 8B45E4               movl    -28(%ebp), %eax
 3687 007b 83C410               addl    $16, %esp
...
2702:./layer3.i    ****     double sq=sqrt(1.0+Ci[i]*Ci[i]);
 3710 00a0 DD83E01E             fldl    Ci.0(%ebx)
 3710      0000
 3711 00a6 89B570FF             movl    %esi, -144(%ebp)
 3711      FFFF
 3712 00ac 89BD74FF             movl    %edi, -140(%ebp)
 3712      FFFF
 3713 00b2 D8C8                 fmul    %st(0), %st
 3714 00b4 DD8570FF             fldl    -144(%ebp)
 3714      FFFF
 3715 00ba DCC1                 fadd    %st, %st(1)
 3716 00bc D9C1                 fld     %st(1)
 3717 00be D9FA                 fsqrt
 3718 00c0 DDE0                 fucom   %st(0)
 3719 00c2 DFE0                 fnstsw  %ax
 3720 00c4 80E445               andb    $69, %ah
 3721 00c7 80FC40               cmpb    $64, %ah
 3722 00ca 7416                 je      .L249
 3723 00cc DDD8                 fstp    %st(0)
 3724 00ce DDD8                 fstp    %st(0)
 3725 00d0 83EC10               subl    $16, %esp	<- 16 extra
 3726 00d3 DD1C24               fstpl   (%esp)
 3727 00d6 E8FCFFFF             call    sqrt
 3727      FF
 3728 00db 83C410               addl    $16, %esp
...
2709:./layer3.i    ****     win[0][i]    = win[1][i]    = 0.5 * sin( 
3.14159265358979323846  / 72.0 * (double) (2*(i+0) +1)
 3761                   .LM23:
 3762 0110 83EC08               subl    $8, %esp
 3763 0113 8D4301               leal    1(%ebx), %eax
 3764 0116 50                   pushl   %eax
 3765 0117 DB0424               fildl   (%esp)
 3766 011a 58                   popl    %eax
 3767 011b 83EC08               subl    $8, %esp	<- 8 extra
 3768 011e DC0D0800             fmull   .LC2
 3768      0000
 3769 0124 DD1C24               fstpl   (%esp)
 3770 0127 E8FCFFFF             call    sin
 3770      FF
 3771 012c 59                   popl    %ecx
 3772 012d 8D4313               leal    19(%ebx), %eax
 3773 0130 DC0D1000             fmull   .LC3
 3773      0000
 3774 0136 5E                   popl    %esi
 3775 0137 50                   pushl   %eax
 3776 0138 DB0424               fildl   (%esp)
 3777 013b D9C9                 fxch    %st(1)
 3778 013d 58                   popl    %eax
 3779 013e DBBD78FF             fstpt   -136(%ebp)
 3779      FFFF
 3780 0144 83EC08               subl    $8, %esp
 3781 0147 DC0D1800             fmull   .LC4
 3781      0000
 3782 014d DC352000             fdivl   .LC5
 3782      0000
 3783 0153 DD1C24               fstpl   (%esp)
 3784 0156 E8FCFFFF             call    cos
 ...
2710:./layer3.i    ****     win[0][i+18] = win[3][i+18] = 0.5 * sin( 
3.14159265358979323846  / 72.0 * (double) (2*(i+18)+1)
 3788 0161 58                   popl    %eax
 3789 0162 8D4325               leal    37(%ebx), %eax
 3792 0165 DEF1                 fdivp   %st, %st(1)
 3795 0167 5A                   popl    %edx
 3796 0168 50                   pushl   %eax
 3797 0169 DB0424               fildl   (%esp)
 3798 016c D9C9                 fxch    %st(1)
 3799 016e 58                   popl    %eax
 3802 016f DD149D60             fstl    win+288(,%ebx,4)
 3802      4C0100
 3803 0176 DD1C9D40             fstpl   win(,%ebx,4)
 3803      4B0100
 3806 017d 83EC08               subl    $8, %esp	<- 8 extra
 3807 0180 DC0D0800             fmull   .LC2
 3807      0000
 3808 0186 DD1C24               fstpl   (%esp)
 3809 0189 E8FCFFFF             call    sin
 3809      FF
 3810 018e 5E                   popl    %esi
 3811 018f 8D4337               leal    55(%ebx), %eax
 3812 0192 DC0D1000             fmull   .LC3
 3812      0000
 3813 0198 5F                   popl    %edi
 3814 0199 50                   pushl   %eax
 3815 019a DB0424               fildl   (%esp)
 3816 019d D9C9                 fxch    %st(1)
 3817 019f 58                   popl    %eax
 3818 01a0 DBBD78FF             fstpt   -136(%ebp)
 3818      FFFF
 3819 01a6 83EC08               subl    $8, %esp	<- 8 extra
 3820 01a9 DC0D1800             fmull   .LC4
 3820      0000
 3821 01af DC352000             fdivl   .LC5
 3821      0000
 3822 01b5 DD1C24               fstpl   (%esp)
 3823 01b8 E8FCFFFF             call    cos
...
2908:./layer3.i    ****        gr_info->part2_3_length = getbits(12);
 5361 0e10 83EC0C               subl    $12, %esp	<- 12 extra
 5362 0e13 6A0C                 pushl   $12
 5363 0e15 E8FCFFFF             call    getbits
 5363      FF
 5364 0e1a 894304               movl    %eax, 4(%ebx)
2909:./layer3.i    ****        gr_info->big_values = getbits_fast(9);
 5367 0e1d C7042409             movl    $9, (%esp)
 5367      000000
 5368 0e24 E8FCFFFF             call    getbits_fast
 5368      FF
 5369 0e29 894308               movl    %eax, 8(%ebx)
2910:./layer3.i    ****        gr_info->pow2gain = gainpow2+256 - 
getbits_fast(8) + powdiff;
 5372 0e2c C7042408             movl    $8, (%esp)
 5372      000000
 5373 0e33 E8FCFFFF             call    getbits_fast
 5373      FF
2911:./layer3.i    ****        if(ms_stereo)
 5376 0e38 8B4D10               movl    16(%ebp), %ecx
 5379 0e3b 89C2                 movl    %eax, %edx
 5380 0e3d 8B45E8               movl    -24(%ebp), %eax
 5383 0e40 83C410               addl    $16, %esp
...

Toshi



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