This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/12329] New: x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
- From: "jbeulich at novell dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Sep 2003 13:56:31 -0000
- Subject: [Bug c/12329] New: x86: local function declared with attribute((regparm(3))) gets corrupted parent frame pointer
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12329
Summary: x86: local function declared with
attribute((regparm(3))) gets corrupted parent frame
pointer
Product: gcc
Version: 3.3.1
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jbeulich at novell dot com
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
Since the parent function's frame pointer is passed in ECX, that register should
not be available for argument passing. However, the third parameter is assigned
to ECX, and thus the callee's assumption of (also) finding the frame pointer
there breaks.
int test(int i) {
static int __attribute__((__regparm__(3))) stest(int j, int k, int l) {
return i + j + k + l;
}
return stest(i, i, i) * i;
}