This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/29305] New: local label-as-value being placed before function prolog
- From: "jeremy at goop dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Oct 2006 04:33:20 -0000
- Subject: [Bug c/29305] New: local label-as-value being placed before function prolog
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
In this code:
static void *bof;
int foo()
{
__label__ boo;
boo: bar();
bof = &&boo;
}
the label "boo" is emitted as .L2, but it is being placed before the function
prologue:
foo:
.L2:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
call bar
movl $.L2, bof
leave
ret
If I add a goto to the label, it is placed correctly:
static void *bof;
int foo()
{
__label__ boo;
boo: bar();
bof = &&boo;
goto boo;
}
foo:
pushl %ebp
movl %esp, %ebp
subl $8, %esp
.L3:
call bar
movl $.L3, bof
jmp .L3
--
Summary: local label-as-value being placed before function prolog
Product: gcc
Version: 4.1.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jeremy at goop dot org
GCC build triplet: i386-redhat-linux
GCC host triplet: i386-redhat-linux
GCC target triplet: i386-redhat-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29305