🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

1 total messages Started by Tony Hosking Tue, 14 Apr 1992 07:58
Labels as values in gcc-2.1
#393
Author: Tony Hosking
Date: Tue, 14 Apr 1992 07:58
30 lines
1167 bytes
GCC version 2.1 on a DECStation 3100 running Ultrix-4.1 compiles the following
program wrongly when the -O flag is used:

#include <stdio.h>

int main (void) {
  __label__ lab;

  void *try (void) {
    return &&lab;
  }

  goto *try();
  return;
 lab:
  printf ("Hello world!\n");
}

gcc inadvertently eliminates the code at the label "lab" since it believes it
to be dead.  Surely taking the address of a label using && should indicate to
the optimizer that the code is indeed reachable!

Thanks,

		Tony Hosking
Papernet:	Dept. of Computer Science
		University of Massachusetts			 _--_|\
		Amherst, MA 01003				/      \
Voicenet:	(413) 545-0256					\_.--._/    )
Internet:	hosking@cs.umass.edu				      v    /
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads