public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/31391]  New: [4.3 Regression] undefined label with -O -g
@ 2007-03-29 12:53 tbm at cyrius dot com
  2007-03-29 12:56 ` [Bug debug/31391] " tbm at cyrius dot com
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2007-03-29 12:53 UTC (permalink / raw)
  To: gcc-bugs

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 <netdb.h>
#include <stdio.h>
#include <malloc.h>

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


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

end of thread, other threads:[~2007-04-02  5:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
2007-03-29 12:56 ` [Bug debug/31391] " tbm at cyrius dot com
2007-03-29 14:12 ` pinskia at gcc dot gnu dot org
2007-03-30 14:21 ` steven at gcc dot gnu dot org
2007-03-30 14:22 ` steven at gcc dot gnu dot org
2007-03-30 14:22 ` steven at gcc dot gnu dot org
2007-03-30 14:30 ` tbm at gcc dot gnu dot org
2007-03-30 19:39 ` steven at gcc dot gnu dot org
2007-03-30 20:16 ` [Bug debug/31391] [4.3 Regression] undefined label with -O -g due to cfglayout steven at gcc dot gnu dot org
2007-03-30 22:29 ` steven at gcc dot gnu dot org
2007-03-31  0:45 ` [Bug rtl-optimization/31391] " tbm at cyrius dot com
2007-04-01 18:26 ` steven at gcc dot gnu dot org
2007-04-02  5:41 ` steven 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).