This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: abysmal code generated by gcc 3.2
- From: Denys Duchier <Denys dot Duchier at ps dot uni-sb dot de>
- To: Joe Wilson <developir at yahoo dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Mon, 21 Oct 2002 16:53:36 +0200
- Subject: Re: abysmal code generated by gcc 3.2
- References: <20021021142058.25276.qmail@web21104.mail.yahoo.com>
Joe Wilson <developir@yahoo.com> writes:
> Hello Denys,
>
> If you compile with -O instead of -O3 you will get the following
> code for MOVEXX for GCC 3.2, which is similar to what you had for GCC 2.95:
>
> /usr/local/gcc3_2/bin/gcc -S -fno-exceptions -O -pipe -fstrict-aliasing -march=pentium
> -mcpu=pentiumpro -fomit-frame-pointer emulate.ii
>
> MOVEXX:
> /NO_APP
> movl 8(%ebp), %eax
> movl 4(%ebp), %edx
> movl (%edx), %edx
> movl %edx, (%eax)
> addl $12, %ebp
> jmp *(%ebp)
>
> I am not sure which GCC -O2 + optimization is causing the code quality regression.
> If you do find out, please share it with the GCC list.
As I mentioned to Brad Lucier (pc), it seems that the poor code
generation is somehow triggered in connection with inlining. IIRC (I
have tried so many variations) If I supply -fno-inline-functions then
indeed I get the code above. This very marginally improves straight
emulated recursion, but degrades the rest of the emulated
instructions. Overall, its a loss. Any further lowering of the
optimization level also leads to a degradation in performance.
Cheers,
--
Dr. Denys Duchier Denys.Duchier@ps.uni-sb.de
Forschungsbereich Programmiersysteme (Programming Systems Lab)
Universitaet des Saarlandes, Geb. 45 http://www.ps.uni-sb.de/~duchier
Postfach 15 11 50 Phone: +49 681 302 5618
66041 Saarbruecken, Germany Fax: +49 681 302 5615