public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/27657]  New: [4.2 regression] bogus undefined reference error to static var with -g and -O
@ 2006-05-18 13:35 tbm at cyrius dot com
  2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
                   ` (24 more replies)
  0 siblings, 25 replies; 26+ messages in thread
From: tbm at cyrius dot com @ 2006-05-18 13:35 UTC (permalink / raw)
  To: gcc-bugs

I get an "undefined reference" error when linking two files but that variable
is static.  This only happens with gcc 4.2, and only when I enable both -g and
-O1 (or higher).

(sid)473:tbm@reyes: ~] cat test.c
static const char utf8_skip_data[1] = {1};
static const char * const gconf_g_utf8_skip = utf8_skip_data;
(sid)474:tbm@reyes: ~] cat main.c
int main() {
}
(sid)475:tbm@reyes: ~] gcc -c -o main.o main.c
(sid)476:tbm@reyes: ~] gcc -c -g -O2 -o test.o test.c
(sid)477:tbm@reyes: ~] gcc main.o test.o
test.o:(.debug_info+0x93): undefined reference to `utf8_skip_data'
collect2: ld returned 1 exit status
zsh: exit 1     gcc main.o test.o
(sid)478:tbm@reyes: ~] gcc-4.1 -c -g -O2 -o test.o test.c
(sid)479:tbm@reyes: ~] gcc main.o test.o
(sid)480:tbm@reyes: ~] gcc -c -g -O0 -o test.o test.c
(sid)481:tbm@reyes: ~] gcc main.o test.o
(sid)482:tbm@reyes: ~]

This is with 4.2.0 20060419.  20060517 shows the same.


-- 
           Summary: [4.2 regression] bogus undefined reference error to
                    static var with -g and -O
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: tbm at cyrius dot com
 GCC build triplet: powerpc-linux-gnu
  GCC host triplet: powerpc-linux-gnu
GCC target triplet: powerpc-linux-gnu


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
@ 2006-05-18 16:50 ` pinskia at gcc dot gnu dot org
  2006-05-29  3:07 ` amodra at bigpond dot net dot au
                   ` (23 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-05-18 16:50 UTC (permalink / raw)
  To: gcc-bugs



-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hubicka at gcc dot gnu dot
                   |                            |org
   Target Milestone|---                         |4.2.0


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
  2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
@ 2006-05-29  3:07 ` amodra at bigpond dot net dot au
  2006-06-04 19:13 ` mmitchel at gcc dot gnu dot org
                   ` (22 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: amodra at bigpond dot net dot au @ 2006-05-29  3:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from amodra at bigpond dot net dot au  2006-05-29 03:07 -------
Confirmed.  The reference is the relocation for DW_AT_const_value.
$ readelf -wi test.o
[snip]
 <1><7a>: Abbrev Number: 8 (DW_TAG_variable)
     DW_AT_name        : (indirect string, offset: 0x0): gconf_g_utf8_skip
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 2
     DW_AT_type        : <89>
     DW_AT_const_value : 0
[snip]
$ readelf -r test.o
Relocation section '.rela.debug_info' at offset 0x53c contains 8 entries:
[snip]
00000085  00000b01 R_PPC_ADDR32      00000000   utf8_skip_data + 0


-- 

amodra at bigpond dot net dot au changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |amodra at bigpond dot net
                   |                            |dot au
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2006-05-29 03:07:05
               date|                            |


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
  2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
  2006-05-29  3:07 ` amodra at bigpond dot net dot au
@ 2006-06-04 19:13 ` mmitchel at gcc dot gnu dot org
  2006-06-29 19:27 ` pinskia at gcc dot gnu dot org
                   ` (21 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2006-06-04 19:13 UTC (permalink / raw)
  To: gcc-bugs



-- 

mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (2 preceding siblings ...)
  2006-06-04 19:13 ` mmitchel at gcc dot gnu dot org
@ 2006-06-29 19:27 ` pinskia at gcc dot gnu dot org
  2006-08-07 11:59 ` hubicka at gcc dot gnu dot org
                   ` (20 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-29 19:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-06-29 19:21 -------
*** Bug 27950 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |gcc at pdoerfler dot com


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (3 preceding siblings ...)
  2006-06-29 19:27 ` pinskia at gcc dot gnu dot org
@ 2006-08-07 11:59 ` hubicka at gcc dot gnu dot org
  2006-08-10  7:36 ` pinskia at gcc dot gnu dot org
                   ` (19 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: hubicka at gcc dot gnu dot org @ 2006-08-07 11:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from hubicka at gcc dot gnu dot org  2006-08-07 11:59 -------
Created an attachment (id=12037)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12037&action=view)
patch

It looks like we should bite the bullet and let cgraph code to output the debug
info....  I am testing the attached patch

Honza


-- 


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


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

* [Bug tree-optimization/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (4 preceding siblings ...)
  2006-08-07 11:59 ` hubicka at gcc dot gnu dot org
@ 2006-08-10  7:36 ` pinskia at gcc dot gnu dot org
  2006-08-27 22:33 ` [Bug middle-end/27657] " pinskia at gcc dot gnu dot org
                   ` (18 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-10  7:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-08-10 07:35 -------
*** Bug 28673 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marcus at jet dot franken
                   |                            |dot de


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (5 preceding siblings ...)
  2006-08-10  7:36 ` pinskia at gcc dot gnu dot org
@ 2006-08-27 22:33 ` pinskia at gcc dot gnu dot org
  2006-08-28 19:43 ` janis at gcc dot gnu dot org
                   ` (17 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-27 22:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pinskia at gcc dot gnu dot org  2006-08-27 22:32 -------
Janis,
  Can you do a regression hunt on this bug?
I almost think it was caused by revision 112408.


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janis at gcc dot gnu dot org
   Last reconfirmed|2006-05-29 03:07:05         |2006-08-27 22:32:58
               date|                            |


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (6 preceding siblings ...)
  2006-08-27 22:33 ` [Bug middle-end/27657] " pinskia at gcc dot gnu dot org
@ 2006-08-28 19:43 ` janis at gcc dot gnu dot org
  2006-08-28 20:36 ` pinskia at gcc dot gnu dot org
                   ` (16 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: janis at gcc dot gnu dot org @ 2006-08-28 19:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from janis at gcc dot gnu dot org  2006-08-28 19:43 -------
A regression hunt on powerpc-linux identified the following patch:

    http://gcc.gnu.org/viewcvs?view=rev&rev=112361

    r112361 | geoffk | 2006-03-24 21:59:48 +0000 (Fri, 24 Mar 2006)

The log message and the ChangeLog entry don't mention it, but this patch also
modifies gcc/dwarf2out.c.


-- 

janis at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |geoffk at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (7 preceding siblings ...)
  2006-08-28 19:43 ` janis at gcc dot gnu dot org
@ 2006-08-28 20:36 ` pinskia at gcc dot gnu dot org
  2006-08-28 20:44 ` geoffk at gcc dot gnu dot org
                   ` (15 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-08-28 20:36 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from pinskia at gcc dot gnu dot org  2006-08-28 20:36 -------
(In reply to comment #6)
> The log message and the ChangeLog entry don't mention it, but this patch also
> modifies gcc/dwarf2out.c.

It was backed out right after the commit:
http://gcc.gnu.org/viewcvs?view=rev&revision=112362

But that would mean it was caused by the revision which I had mentioned in
comment #5 as that revision put the code back in.


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (8 preceding siblings ...)
  2006-08-28 20:36 ` pinskia at gcc dot gnu dot org
@ 2006-08-28 20:44 ` geoffk at gcc dot gnu dot org
  2006-08-28 22:58 ` janis at gcc dot gnu dot org
                   ` (14 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: geoffk at gcc dot gnu dot org @ 2006-08-28 20:44 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 943 bytes --]



------- Comment #8 from geoffk at gcc dot gnu dot org  2006-08-28 20:44 -------

(In reply to comment #3)
> Created an attachment (id=12037)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12037&action=view) [edit]
> patch
> 
> It looks like we should bite the bullet and let cgraph code to output the debug
> info....  I am testing the attached patch
> 
It looks like this patch will prevent the output of debug information for
variables that are optimized out, but that's wrong; the variables should be
visible to the user in the debugger even if they are optimized away.

I think the actual problem is that reference_to_unused in dwarf2out.c is
checking TREE_USED and expecting all used variables to be output, but that
doesn't seem to be happening in this case.  Perhaps there is something in
cgraph which can be called to ask if a variable is *really* going to be output?


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (9 preceding siblings ...)
  2006-08-28 20:44 ` geoffk at gcc dot gnu dot org
@ 2006-08-28 22:58 ` janis at gcc dot gnu dot org
  2006-10-20  7:42 ` pinskia at gcc dot gnu dot org
                   ` (13 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: janis at gcc dot gnu dot org @ 2006-08-28 22:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from janis at gcc dot gnu dot org  2006-08-28 22:58 -------
I can confirm that the latest regression is from r112408.


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (10 preceding siblings ...)
  2006-08-28 22:58 ` janis at gcc dot gnu dot org
@ 2006-10-20  7:42 ` pinskia at gcc dot gnu dot org
  2006-12-11 20:23 ` [Bug middle-end/27657] [4.2/4.3 " reichelt at gcc dot gnu dot org
                   ` (12 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-20  7:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from pinskia at gcc dot gnu dot org  2006-10-20 07:42 -------
*** Bug 29417 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |peter at chocky dot org


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


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

* [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (11 preceding siblings ...)
  2006-10-20  7:42 ` pinskia at gcc dot gnu dot org
@ 2006-12-11 20:23 ` reichelt at gcc dot gnu dot org
  2006-12-26 17:37 ` pinskia at gcc dot gnu dot org
                   ` (11 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2006-12-11 20:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from reichelt at gcc dot gnu dot org  2006-12-11 20:23 -------
Btw, the following C++ example fails to link even without -O:

=============================
const char s[] = "";
const char *const p = s;

int main()
{
  return 0;
}
=============================


-- 

reichelt at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |reichelt at gcc dot gnu dot
                   |                            |org
           Keywords|                            |monitored


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


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

* [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (12 preceding siblings ...)
  2006-12-11 20:23 ` [Bug middle-end/27657] [4.2/4.3 " reichelt at gcc dot gnu dot org
@ 2006-12-26 17:37 ` pinskia at gcc dot gnu dot org
  2007-01-29 15:44 ` rguenth at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-12-26 17:37 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #12 from pinskia at gcc dot gnu dot org  2006-12-26 17:37 -------
*** Bug 30305 has been marked as a duplicate of this bug. ***


-- 

pinskia at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pluto at agmk dot net


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


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

* [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (13 preceding siblings ...)
  2006-12-26 17:37 ` pinskia at gcc dot gnu dot org
@ 2007-01-29 15:44 ` rguenth at gcc dot gnu dot org
  2007-01-29 15:50 ` rguenth at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-29 15:44 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #13 from rguenth at gcc dot gnu dot org  2007-01-29 15:43 -------
I'm testing

Index: dwarf2out.c
===================================================================
--- dwarf2out.c (revision 121287)
+++ dwarf2out.c (working copy)
@@ -10045,8 +10045,14 @@ reference_to_unused (tree * tp, int * wa
   if (DECL_P (*tp) && ! TREE_PUBLIC (*tp) && ! TREE_USED (*tp)
       && ! TREE_ASM_WRITTEN (*tp))
     return *tp;
-  else
-    return NULL_TREE;
+  else if (DECL_P (*tp))
+    {
+      struct varpool_node *node = varpool_node (*tp);
+      if (!node->needed)
+       return *tp;
+    }
+
+  return NULL_TREE;
 }

 /* Generate an RTL constant from a decl initializer INIT with decl type TYPE,


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |rguenth at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-08-27 22:32:58         |2007-01-29 15:43:49
               date|                            |


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


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

* [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (14 preceding siblings ...)
  2007-01-29 15:44 ` rguenth at gcc dot gnu dot org
@ 2007-01-29 15:50 ` rguenth at gcc dot gnu dot org
  2007-01-30 10:23 ` rguenth at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-29 15:50 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #14 from rguenth at gcc dot gnu dot org  2007-01-29 15:49 -------
*** Bug 30629 has been marked as a duplicate of this bug. ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mueller at gcc dot gnu dot
                   |                            |org


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


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

* [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (15 preceding siblings ...)
  2007-01-29 15:50 ` rguenth at gcc dot gnu dot org
@ 2007-01-30 10:23 ` rguenth at gcc dot gnu dot org
  2007-01-30 10:24 ` [Bug middle-end/27657] [4.2 " rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-30 10:23 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #15 from rguenth at gcc dot gnu dot org  2007-01-30 10:23 -------
Subject: Bug 27657

Author: rguenth
Date: Tue Jan 30 10:23:01 2007
New Revision: 121335

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121335
Log:
2007-01-30  Richard Guenther  <rguenther@suse.de>

        PR middle-end/27657
        * dwarf2out.c (reference_to_unused): Query varpool if the
        variable was output.

        * g++.dg/debug/pr27657.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/debug/pr27657.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/dwarf2out.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (16 preceding siblings ...)
  2007-01-30 10:23 ` rguenth at gcc dot gnu dot org
@ 2007-01-30 10:24 ` rguenth at gcc dot gnu dot org
  2007-01-31 12:29 ` rguenth at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-30 10:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #16 from rguenth at gcc dot gnu dot org  2007-01-30 10:23 -------
Fixed on the mainline.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|4.1.1 4.1.2                 |4.1.1 4.1.2 4.3.0
            Summary|[4.2/4.3 regression] bogus  |[4.2 regression] bogus
                   |undefined reference error to|undefined reference error to
                   |static var with -g and -O   |static var with -g and -O


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (17 preceding siblings ...)
  2007-01-30 10:24 ` [Bug middle-end/27657] [4.2 " rguenth at gcc dot gnu dot org
@ 2007-01-31 12:29 ` rguenth at gcc dot gnu dot org
  2007-02-01 19:25 ` ismail at pardus dot org dot tr
                   ` (5 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-01-31 12:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #17 from rguenth at gcc dot gnu dot org  2007-01-31 12:28 -------
*** Bug 30651 has been marked as a duplicate of this bug. ***


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aanisimov at inbox dot ru


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (18 preceding siblings ...)
  2007-01-31 12:29 ` rguenth at gcc dot gnu dot org
@ 2007-02-01 19:25 ` ismail at pardus dot org dot tr
  2007-02-01 19:33 ` tbm at cyrius dot com
                   ` (4 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ismail at pardus dot org dot tr @ 2007-02-01 19:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #18 from ismail at pardus dot org dot tr  2007-02-01 19:25 -------
Any chance of a 4.2 backport ? Looks like varpool_node does not exist in 4.2
branch.


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (19 preceding siblings ...)
  2007-02-01 19:25 ` ismail at pardus dot org dot tr
@ 2007-02-01 19:33 ` tbm at cyrius dot com
  2007-02-01 19:51 ` ismail at pardus dot org dot tr
                   ` (3 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: tbm at cyrius dot com @ 2007-02-01 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #19 from tbm at cyrius dot com  2007-02-01 19:32 -------
(In reply to comment #18)
> Any chance of a 4.2 backport ? Looks like varpool_node does not exist in 4.2
> branch.

I noticed this as well.  It's easy enough to fix:

14:20 < richi> tbm: sure s/varpool_/cgraph_varpool_/

Richi has already tested the patch on 4.2 so I assume he'll apply it soon.


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (20 preceding siblings ...)
  2007-02-01 19:33 ` tbm at cyrius dot com
@ 2007-02-01 19:51 ` ismail at pardus dot org dot tr
  2007-02-04 15:28 ` rguenth at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  24 siblings, 0 replies; 26+ messages in thread
From: ismail at pardus dot org dot tr @ 2007-02-01 19:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #20 from ismail at pardus dot org dot tr  2007-02-01 19:51 -------
(In reply to comment #19)
> (In reply to comment #18)
> > Any chance of a 4.2 backport ? Looks like varpool_node does not exist in 4.2
> > branch.
> 
> I noticed this as well.  It's easy enough to fix:
> 
> 14:20 < richi> tbm: sure s/varpool_/cgraph_varpool_/
> 
> Richi has already tested the patch on 4.2 so I assume he'll apply it soon.

Nice, thanks :)


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (21 preceding siblings ...)
  2007-02-01 19:51 ` ismail at pardus dot org dot tr
@ 2007-02-04 15:28 ` rguenth at gcc dot gnu dot org
  2007-02-04 15:30 ` rguenth at gcc dot gnu dot org
  2007-02-04 17:52 ` tbm at cyrius dot com
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-04 15:28 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #21 from rguenth at gcc dot gnu dot org  2007-02-04 15:28 -------
Subject: Bug 27657

Author: rguenth
Date: Sun Feb  4 15:27:53 2007
New Revision: 121576

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=121576
Log:
2007-02-04  Richard Guenther  <rguenther@suse.de>

        Backport from mainline:
        2007-01-30  Richard Guenther  <rguenther@suse.de>

        PR middle-end/27657
        * dwarf2out.c (reference_to_unused): Query varpool if the
        variable was output.

        * g++.dg/debug/pr27657.C: New testcase.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/debug/pr27657.C
      - copied unchanged from r121335,
trunk/gcc/testsuite/g++.dg/debug/pr27657.C
Modified:
    branches/gcc-4_2-branch/gcc/ChangeLog
    branches/gcc-4_2-branch/gcc/dwarf2out.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (22 preceding siblings ...)
  2007-02-04 15:28 ` rguenth at gcc dot gnu dot org
@ 2007-02-04 15:30 ` rguenth at gcc dot gnu dot org
  2007-02-04 17:52 ` tbm at cyrius dot com
  24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-02-04 15:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #22 from rguenth at gcc dot gnu dot org  2007-02-04 15:29 -------
Fixed.


-- 

rguenth at gcc dot gnu dot org changed:

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


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


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

* [Bug middle-end/27657] [4.2 regression] bogus undefined reference error to static var with -g and -O
  2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
                   ` (23 preceding siblings ...)
  2007-02-04 15:30 ` rguenth at gcc dot gnu dot org
@ 2007-02-04 17:52 ` tbm at cyrius dot com
  24 siblings, 0 replies; 26+ messages in thread
From: tbm at cyrius dot com @ 2007-02-04 17:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #23 from tbm at cyrius dot com  2007-02-04 17:52 -------
(In reply to comment #22)
> Fixed.

I can confirm this - with the exception of one case for which I filed a new
report: PR30700.


-- 


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


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

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

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 13:35 [Bug tree-optimization/27657] New: [4.2 regression] bogus undefined reference error to static var with -g and -O tbm at cyrius dot com
2006-05-18 16:50 ` [Bug tree-optimization/27657] " pinskia at gcc dot gnu dot org
2006-05-29  3:07 ` amodra at bigpond dot net dot au
2006-06-04 19:13 ` mmitchel at gcc dot gnu dot org
2006-06-29 19:27 ` pinskia at gcc dot gnu dot org
2006-08-07 11:59 ` hubicka at gcc dot gnu dot org
2006-08-10  7:36 ` pinskia at gcc dot gnu dot org
2006-08-27 22:33 ` [Bug middle-end/27657] " pinskia at gcc dot gnu dot org
2006-08-28 19:43 ` janis at gcc dot gnu dot org
2006-08-28 20:36 ` pinskia at gcc dot gnu dot org
2006-08-28 20:44 ` geoffk at gcc dot gnu dot org
2006-08-28 22:58 ` janis at gcc dot gnu dot org
2006-10-20  7:42 ` pinskia at gcc dot gnu dot org
2006-12-11 20:23 ` [Bug middle-end/27657] [4.2/4.3 " reichelt at gcc dot gnu dot org
2006-12-26 17:37 ` pinskia at gcc dot gnu dot org
2007-01-29 15:44 ` rguenth at gcc dot gnu dot org
2007-01-29 15:50 ` rguenth at gcc dot gnu dot org
2007-01-30 10:23 ` rguenth at gcc dot gnu dot org
2007-01-30 10:24 ` [Bug middle-end/27657] [4.2 " rguenth at gcc dot gnu dot org
2007-01-31 12:29 ` rguenth at gcc dot gnu dot org
2007-02-01 19:25 ` ismail at pardus dot org dot tr
2007-02-01 19:33 ` tbm at cyrius dot com
2007-02-01 19:51 ` ismail at pardus dot org dot tr
2007-02-04 15:28 ` rguenth at gcc dot gnu dot org
2007-02-04 15:30 ` rguenth at gcc dot gnu dot org
2007-02-04 17:52 ` tbm at cyrius dot com

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