diff options
author | Nathan Sidwell <nathan@acm.org> | 2015-12-23 14:47:39 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2015-12-23 14:47:39 +0000 |
commit | 7ec4f3438cd3fc7a83a32d6c9b910b26a220376e (patch) | |
tree | 23ff2500b938c7cf94d14dd55668e27574e466b8 /gcc/cgraph.h | |
parent | 986e29bc6a3df0269268d7045058049beb26e1cb (diff) | |
download | gcc-7ec4f3438cd3fc7a83a32d6c9b910b26a220376e.zip gcc-7ec4f3438cd3fc7a83a32d6c9b910b26a220376e.tar.gz gcc-7ec4f3438cd3fc7a83a32d6c9b910b26a220376e.tar.bz2 |
alias.c (compare_base_decls): Simplify in-symtab check.
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.
From-SVN: r231928
Diffstat (limited to 'gcc/cgraph.h')
-rw-r--r-- | gcc/cgraph.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/cgraph.h b/gcc/cgraph.h index ba14215..fe7c194 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)))); } |