public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/26187]  New: computed goto code does not produce jumps
@ 2006-02-09  0:29 bje at gcc dot gnu dot org
  2006-02-09  0:32 ` [Bug middle-end/26187] " pinskia at gcc dot gnu dot org
  2006-02-09  0:38 ` bje at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: bje at gcc dot gnu dot org @ 2006-02-09  0:29 UTC (permalink / raw)
  To: gcc-bugs

When compiling the test case below, the assembly output shows jmps through eax
to the destination pointer, p, for the functions goto0 and goto2 (which contain
zero and two expressions that take the address of a label).  In function goto1,
which only takes the address of one label, there is no jmp instruction
generated.  The test case originally assigned the label addresses to void *
auto variables, but I removed those while simplifying the test.

I've been able to reproduce this problem on powerpc-linux-gnu also, so it
appears to be target independent.

Compile with gcc -S foo.c and examine foo.s.

extern int printf (const char *format, ...);
int x;

void goto0 (void *p)
{
  goto *p;
}

void goto1 (void *p)
{
  &&label;
  goto *p;
 label:
  x = 0;
}

void goto2 (void *p)
{
  &&label1;
  &&label2;
  goto *p;
 label1:
 label2:
  x = 0;
}


-- 
           Summary: computed goto code does not produce jumps
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bje at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu


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


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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-26187-4@http.gcc.gnu.org/bugzilla/>
2024-03-16 17:54 ` [Bug middle-end/26187] computed goto code does not produce jumps pinskia at gcc dot gnu.org
2006-02-09  0:29 [Bug middle-end/26187] New: " bje at gcc dot gnu dot org
2006-02-09  0:32 ` [Bug middle-end/26187] " pinskia at gcc dot gnu dot org
2006-02-09  0:38 ` bje at gcc dot gnu dot 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).