From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18591 invoked by alias); 29 Mar 2007 12:53:24 -0000 Received: (qmail 17972 invoked by uid 48); 29 Mar 2007 12:53:04 -0000 Date: Thu, 29 Mar 2007 12:53:00 -0000 Subject: [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "tbm at cyrius dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg02701.txt.bz2 I get the following link error with 4.3 and -O -g: $ gcc -c -g -O test.c -o test.o $ gcc -o m m.c test.o test.o:(.debug_info+0x539): undefined reference to `.L4' collect2: ld returned 1 exit status test.c: #include #include #include typedef struct _hostEntry { struct _hostEntry *next; int type; } HostEntry; typedef struct _displayEntry { struct _displayEntry *next; int type; int chooser; HostEntry *hosts; } DisplayEntry; char* name; char *ReadWord(FILE *file) { return name; } static HostEntry * ReadHostEntry (FILE *file) { char *hostOrAlias; HostEntry *h; struct hostent *hostent; tryagain: hostOrAlias = ReadWord (file); if (!hostOrAlias) return NULL; h = (HostEntry *) malloc (sizeof (DisplayEntry)); if (!hostent) { free ((char *) h); goto tryagain; } return h; } static DisplayEntry * ReadDisplayEntry (FILE *file) { DisplayEntry *d; HostEntry *h, **prev; struct hostent *hostent; switch (hostent->h_addrtype) { default: break; } prev = &d->hosts; while ((h = ReadHostEntry (file))) { if (h->type == 3) { d->chooser = 1; } else { *prev = h; prev = &h->next; } } return d; } int ScanAccessDatabase (FILE *file) { ReadDisplayEntry (file); } m.c: int main() { } -- Summary: [4.3 Regression] undefined label with -O -g Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: debug AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: tbm at cyrius dot com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31391