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: -fomit-frame-pointer interaction with alloca - egcs-1.0.1


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.



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