public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/29305]  New: local label-as-value being placed before function prolog
@ 2006-10-01  4:33 jeremy at goop dot org
  2006-10-01  4:43 ` [Bug c/29305] " pinskia at gcc dot gnu dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 13+ messages in thread
From: jeremy at goop dot org @ 2006-10-01  4:33 UTC (permalink / raw)
  To: gcc-bugs

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


^ permalink raw reply	[flat|nested] 13+ messages in thread
[parent not found: <bug-29305-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2024-03-16 18:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-01  4:33 [Bug c/29305] New: local label-as-value being placed before function prolog jeremy at goop dot org
2006-10-01  4:43 ` [Bug c/29305] " pinskia at gcc dot gnu dot org
2006-10-01  5:18 ` jeremy at goop dot org
2006-10-01  5:29 ` [Bug middle-end/29305] " pinskia at gcc dot gnu dot org
2006-10-01  5:37 ` jeremy at goop dot org
2006-10-01  5:42 ` jeremy at goop dot org
2006-10-01  5:45 ` pinskia at gcc dot gnu dot org
2006-10-01  5:55 ` jeremy at goop dot org
2006-10-01  6:00 ` jeremy at goop dot org
2006-10-01  6:24 ` pinskia at gcc dot gnu dot org
2006-10-01  8:47 ` jeremy at goop dot org
     [not found] <bug-29305-4@http.gcc.gnu.org/bugzilla/>
2021-01-30 12:18 ` stsp at users dot sourceforge.net
2024-03-16 18:09 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).