summaryrefslogtreecommitdiff
path: root/gcc/cgraph.h
diff options
context:
space:
mode:
authornathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-23 14:47:39 +0000
committernathan <nathan@138bc75d-0d04-0410-961f-82ee72b054a4>2015-12-23 14:47:39 +0000
commit2591ae50594b4e85565c1858bdf73056246485b9 (patch)
tree23ff2500b938c7cf94d14dd55668e27574e466b8 /gcc/cgraph.h
parent8770d0adead2d38444230bf7084ef3d339c8acc8 (diff)
downloadgcc-2591ae50594b4e85565c1858bdf73056246485b9.tar.gz
gcc/
* alias.c (compare_base_decls): Simplify in-symtab check. * cgraph.h (decl_in_symtab_p): Check DECL_IN_CONSTANT_POOL. testsuite/ * gcc.dg/alias-15.c: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231928 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r--gcc/cgraph.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index ba14215ed6f..fe7c1940c4e 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -2294,13 +2294,19 @@ symtab_node::real_symbol_p (void)
}
/* Return true if DECL should have entry in symbol table if used.
- Those are functions and static & external veriables*/
+ Those are functions and static & external non-constpool variables.
+ We do not expect constant pool variables in the varpool, as they're
+ not related to other variables, and simply lazily inserting them
+ using the regular interface results in varpool thinking they are
+ externally provided -- which results in erroneous assembly emission
+ as an undefined decl. */
static inline bool
decl_in_symtab_p (const_tree decl)
{
return (TREE_CODE (decl) == FUNCTION_DECL
|| (TREE_CODE (decl) == VAR_DECL
+ && !DECL_IN_CONSTANT_POOL (decl)
&& (TREE_STATIC (decl) || DECL_EXTERNAL (decl))));
}