This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
RE: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- To: "'Jeffrey A Law'" <law at cygnus dot com>
- Subject: RE: -fomit-frame-pointer interaction with alloca - egcs-1.0.1
- From: John Hughes <john at AtlanTech dot COM>
- Date: Mon, 9 Feb 1998 18:29:45 +0100
- Cc: "Egcs-Bugs Mailing List (E-mail)" <egcs-bugs at cygnus dot com>
Jeff writes:
Jeff> Thanks for the testcase.
Well, here's another. (I patched my egcs to fix the sp update on exit).
Looks like conditional expressions can force unneccesary sp updates:
int dbdir_sort_date (int first_private, int second_private) {
char * name = alloca (( 256 ) + 1) ;
fred (name);
return first_private < second_private ? -1 : 0 ;
}
.file "odd.c" .file "odd.c"
.version "01.01" .version "01.01"
/ GNU C version egcs-2.90.23 980102 ( / GNU C version egcs-2.90.23 980102 (
/ options passed: -O | / options passed: -O -fomit-frame-po
/ options enabled: -fdefer-pop -fthr | / options enabled: -fdefer-pop -fomi
/ -finline -fkeep-static-consts -fpcc | / -fpeephole -ffunction-cse -finline
/ -fgnu-linker -falias-check -fargume | / -fpcc-struct-return -fcommon -fverb
/ -mno-soft-float -mieee-fp -mfp-ret- | / -fargument-alias -m80387 -mhard-flo
/ -march=pentium | / -mfp-ret-in-387 -mschedule-prologue
gcc2_compiled.: gcc2_compiled.:
.text .text
.align 4 .align 4
.globl dbdir_sort_date .globl dbdir_sort_date
.type dbdir_sort_date,@fun .type dbdir_sort_date,@fun
dbdir_sort_date: dbdir_sort_date:
pushl %ebp pushl %ebp
movl %esp,%ebp movl %esp,%ebp
pushl %esi pushl %esi
pushl %ebx pushl %ebx
movl 8(%ebp),%esi movl 8(%ebp),%esi
movl 12(%ebp),%ebx movl 12(%ebp),%ebx
addl $-260,%esp addl $-260,%esp
pushl %esp pushl %esp
call fred call fred
> addl $4,%esp
xorl %eax,%eax xorl %eax,%eax
cmpl %ebx,%esi cmpl %ebx,%esi
jge .L2 jge .L2
movl $-1,%eax movl $-1,%eax
.L2: .L2:
leal -8(%ebp),%esp leal -8(%ebp),%esp
popl %ebx popl %ebx
popl %esi popl %esi
leave leave
ret ret
.Lfe1: .Lfe1:
.size dbdir_sort_date,.Lfe .size dbdir_sort_date,.Lfe
.ident "GCC: (GNU) egcs-2.90 .ident "GCC: (GNU) egcs-2.90
--
John Hughes <john@AtlanTech.COM>,
Atlantic Technologies Inc. Tel: +33-1-43204546
24 rue Montbrun, Fax: +33-1-43204579
75014 PARIS.