This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Jan 2007 15:43:50 -0000
- Subject: [Bug middle-end/27657] [4.2/4.3 regression] bogus undefined reference error to static var with -g and -O
- References: <bug-27657-12387@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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