This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/24419] New: [3.4/4.0/4.1 Regression]: ix86 prologue puts values beyond stack
- From: "hjl at lucon dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Oct 2005 00:48:50 -0000
- Subject: [Bug target/24419] New: [3.4/4.0/4.1 Regression]: ix86 prologue puts values beyond stack
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
[hjl@gnu-9 prologue]$ cat bar.i
struct bar {
short word;
struct bar* next;
};
int foo (struct bar* c, int w, int delta)
{
int i;
if (c==((void *)0)) return w;
i = foo (c->next, w, delta) + delta;
c->word = i;
return i;
}
[hjl@gnu-9 prologue]$ /usr/gcc-4.0/bin/gcc -S -O2 bar.i
[hjl@gnu-9 prologue]$ head -15 bar.s
.file "bar.i"
.text
.p2align 4,,15
.globl foo
.type foo, @function
foo:
.LFB2:
movq %rbx, -16(%rsp)
.LCFI0:
movq %rbp, -8(%rsp)
.LCFI1:
subq $16, %rsp
.LCFI2:
testq %rdi, %rdi
movq %rdi, %rbx
We are putting values beyond the end of the stack. It is wrong and
unsafe. We should adjust the stack first. This regression is introduced by
http://gcc.gnu.org/ml/gcc-patches/2003-03/msg01666.html
--
Summary: [3.4/4.0/4.1 Regression]: ix86 prologue puts values
beyond stack
Product: gcc
Version: 4.1.0
Status: UNCONFIRMED
Severity: major
Priority: P2
Component: target
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: hjl at lucon dot org
GCC target triplet: x86_64-unknown-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24419