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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  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 ` tbm at cyrius dot com
  2007-03-29 14:12 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2007-03-29 12:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tbm at cyrius dot com  2007-03-29 13:56 -------
This problem was introduced between 20070303 and 20070326.


-- 


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  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
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2007-03-29 14:12 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pinskia at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.3.0


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  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
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 14:21 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from steven at gcc dot gnu dot org  2007-03-30 15:21 -------
Looks like the kind of bug that cfglayout mode might introduce.

Will investigate...


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |steven at gcc dot gnu dot
                   |dot org                     |org
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-30 15:21:20
               date|                            |


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  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
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 14:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from steven at gcc dot gnu dot org  2007-03-30 15:21 -------
Looks like the kind of bug that cfglayout mode might introduce.

Will investigate...


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2007-03-30 15:21:20         |2007-03-30 15:21:40
               date|                            |


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 14:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from steven at gcc dot gnu dot org  2007-03-30 15:22 -------
Which target is this, BTW?


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |WAITING


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  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
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: tbm at gcc dot gnu dot org @ 2007-03-30 14:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tbm at gcc dot gnu dot org  2007-03-30 15:29 -------
I've seen it on x86_64 and ia64.


-- 


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 19:39 UTC (permalink / raw)
  To: gcc-bugs



-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |ASSIGNED
   Last reconfirmed|2007-03-30 15:21:40         |2007-03-30 20:39:16
               date|                            |


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g due to cfglayout
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (6 preceding siblings ...)
  2007-03-30 19:39 ` steven at gcc dot gnu dot org
@ 2007-03-30 20:16 ` steven at gcc dot gnu dot org
  2007-03-30 22:29 ` steven at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 20:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from steven at gcc dot gnu dot org  2007-03-30 21:16 -------
At the end of loop2, the tryagain label is turned into a deleted label note. 
This happens because the label has zero uses left in cfglayout. There are only
unconditional jumps to it, unconditional jumps are removed when going into
cfglayout mode (any edge can fall through to any block), and apparently we
rebuild jump labels.  Which shouldn't happen, I think.

Anyway, definitely mine.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[4.3 Regression] undefined  |[4.3 Regression] undefined
                   |label with -O -g            |label with -O -g due to
                   |                            |cfglayout


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


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

* [Bug debug/31391] [4.3 Regression] undefined label with -O -g due to cfglayout
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (7 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-03-30 22:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from steven at gcc dot gnu dot org  2007-03-30 23:29 -------
Index: cfgcleanup.c
===================================================================
--- cfgcleanup.c        (revision 123362)
+++ cfgcleanup.c        (working copy)
@@ -2034,6 +2034,8 @@ try_optimize_cfg (int mode)

                      reorder_insns_nobb (label, label, bb_note);
                      BB_HEAD (b) = bb_note;
+                     if (BB_END (b) == bb_note)
+                       BB_END (b) = label;
                    }
                  if (dump_file)
                    fprintf (dump_file, "Deleted label in block %i.\n",


-- 


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


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

* [Bug rtl-optimization/31391] [4.3 Regression] undefined label with -O -g due to cfglayout
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (8 preceding siblings ...)
  2007-03-30 22:29 ` steven at gcc dot gnu dot org
@ 2007-03-31  0:45 ` 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
  11 siblings, 0 replies; 13+ messages in thread
From: tbm at cyrius dot com @ 2007-03-31  0:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tbm at cyrius dot com  2007-03-31 01:44 -------
This patch works for me.


-- 


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


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

* [Bug rtl-optimization/31391] [4.3 Regression] undefined label with -O -g due to cfglayout
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (9 preceding siblings ...)
  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
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-04-01 18:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from steven at gcc dot gnu dot org  2007-04-01 19:26 -------
Subject: Bug 31391

Author: steven
Date: Sun Apr  1 19:26:00 2007
New Revision: 123406

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123406
Log:
        PR rtl-optimization/31391
        * cfgcleanup.c (try_optimize_cfg): If a removed label is turned
        into a DELETED_LABEL note, and the label is in an empty basic
        block, update BB_END as well as BB_HEAD.

Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cfgcleanup.c


-- 


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


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

* [Bug rtl-optimization/31391] [4.3 Regression] undefined label with -O -g due to cfglayout
  2007-03-29 12:53 [Bug debug/31391] New: [4.3 Regression] undefined label with -O -g tbm at cyrius dot com
                   ` (10 preceding siblings ...)
  2007-04-01 18:26 ` steven at gcc dot gnu dot org
@ 2007-04-02  5:41 ` steven at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: steven at gcc dot gnu dot org @ 2007-04-02  5:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from steven at gcc dot gnu dot org  2007-04-02 06:41 -------
.


-- 

steven at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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).