This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
optimization/8725: spurious stack adjustment
- From: dann at godzilla dot ics dot uci dot edu
- To: gcc-gnats at gcc dot gnu dot org
- Date: 26 Nov 2002 23:42:25 -0000
- Subject: optimization/8725: spurious stack adjustment
- Reply-to: dann at godzilla dot ics dot uci dot edu
>Number: 8725
>Category: optimization
>Synopsis: spurious stack adjustment
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: pessimizes-code
>Submitter-Id: net
>Arrival-Date: Tue Nov 26 15:46:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: dann@godzilla.ics.uci.edu
>Release: CVS
>Organization:
>Environment:
i386-pc-linux-gnu
>Description:
This is a regression from egcs-1.1.2
When compiling the following code with -O2 -S -fomit-frame-pointer
with CVS gcc as of today
struct boo {
int a;
int aa;
};
int foo (void);
int bar (void)
{
struct boo cucu;
cucu.a = 1;
foo();
cucu.a++;
return 0;
}
the following is generated:
bar:
subl $12, %esp
call foo
xorl %eax, %eax
addl $12, %esp
ret
Note the extra subl and addl instructions.
When doing the same thing on an old RedHad-6.2 machine that
has egcs-1.1.2 the generated code is:
bar:
call foo
xorl %eax,%eax
ret
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: