mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-31 23:41:01 +08:00
re PR middle-end/27657 (bogus undefined reference error to static var with -g and -O)
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. From-SVN: r121335
This commit is contained in:
parent
91851351be
commit
9b1959ffca
@ -1,3 +1,9 @@
|
||||
2007-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/27657
|
||||
* dwarf2out.c (reference_to_unused): Query varpool if the
|
||||
variable was output.
|
||||
|
||||
2007-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/30313
|
||||
|
@ -10045,8 +10045,14 @@ reference_to_unused (tree * tp, int * walk_subtrees,
|
||||
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) && TREE_CODE (*tp) != FUNCTION_DECL)
|
||||
{
|
||||
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,
|
||||
|
@ -1,3 +1,8 @@
|
||||
2007-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/27657
|
||||
* g++.dg/debug/pr27657.C: New testcase.
|
||||
|
||||
2007-01-30 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR middle-end/30313
|
||||
|
9
gcc/testsuite/g++.dg/debug/pr27657.C
Normal file
9
gcc/testsuite/g++.dg/debug/pr27657.C
Normal file
@ -0,0 +1,9 @@
|
||||
/* { dg-do link } */
|
||||
|
||||
const char s[] = "";
|
||||
const char *const p = s;
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user