public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/55749] New: gcc 4.7.1 removes labels mistakenly
@ 2012-12-20  4:21 blue_3too at hotmail dot com
  2012-12-20  5:32 ` [Bug c/55749] " pinskia at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: blue_3too at hotmail dot com @ 2012-12-20  4:21 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55749

             Bug #: 55749
           Summary: gcc 4.7.1 removes labels mistakenly
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: blue_3too@hotmail.com


gcc version 4.7.1 (GCC) x86_64-unknown-linux-gnu

in the following small c program, label-as-value always incorrectly uses the
begining of the function (.e. pointer p is always set to the begining of foo).
Turning of scheduling will generate the correct code.

Is this a known bug? any pointer will be appreciated. thanks
>cat m.c

void *p;
extern void bar();
void foo()
{
    p = &&my_label;
    bar();

my_label:

    bar();
}

> gcc -O2 -S m.c

> less m.s

       .globl  foo
        .type   foo, @function
foo:
.LFB0:
.L2:
        subq    $8, %rsp
.LCFI0:
        xorl    %eax, %eax
        movq    $.L2, p(%rip)
        call    bar
        xorl    %eax, %eax
        addq    $8, %rsp
.LCFI1:
        jmp     bar
.LFE0:
        .size   foo, .-foo
        .comm   p,8,8
        .comm   i,4,4


^ permalink raw reply	[flat|nested] 6+ messages in thread

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

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-20  4:21 [Bug c/55749] New: gcc 4.7.1 removes labels mistakenly blue_3too at hotmail dot com
2012-12-20  5:32 ` [Bug c/55749] " pinskia at gcc dot gnu.org
2012-12-20 16:17 ` blue_3too at hotmail dot com
2012-12-20 16:18 ` blue_3too at hotmail dot com
2012-12-20 16:55 ` pinskia at gcc dot gnu.org
2024-03-16 17:57 ` 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).