optimization/3480: gcc-3.0, bad code generated with -O3 -fomit-frame-pointer on intel x86
Juergen Keil
jk@tools.de
Mon Dec 3 04:30:00 GMT 2001
> Synopsis: gcc-3.0, bad code generated with -O3 -fomit-frame-pointer on intel
x86
>
> State-Changed-From-To: open->feedback
> State-Changed-By: rodrigc
> State-Changed-When: Sat Dec 1 22:49:12 2001
> State-Changed-Why:
> I think this has been fixed by:
> http://gcc.gnu.org/ml/gcc-patches/2001-11/msg00698.html
>
> Can you try a gcc 3.0.3 snapshot and verify this?
>
>
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&pr=3480&database=g
cc
Yes, the problem seems to be fixed.
I've downloaded and installed snapshot gcc-20011126 and the code
generated for the problematic function 'acmStreamOpen' looks much better
now:
.type acmStreamOpen,@function
acmStreamOpen:
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $16, %esp
movl 44(%esp), %esi <-- third parameter is now accessed via %esp
with correct offset
movzwl 16(%esi), %ecx
movl 48(%esp), %ebx
In the released versions of gcc-3.0.x, the following buggy code is generated
(from my bug report)
.globl acmStreamOpen
.type acmStreamOpen,@function
acmStreamOpen:
pushl %ebp
pushl %edi
pushl %esi
pushl %ebx
subl $96, %esp
movl 12(%ebp), %esi <--- accesses pwfxSrc as offset(%ebp), no
<--- valid %ebp setup yet!
movzwl 16(%esi), %edx
movl 16(%ebp), %ebx
--
Jürgen Keil jk@tools.de
Tools GmbH +49 (228) 9858011
More information about the Gcc-bugs
mailing list