summaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index b2bd3378802..08e960363b6 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -61,19 +61,21 @@ can_refer_decl_in_current_unit_p (tree decl, tree from_decl)
struct cgraph_node *node;
symtab_node snode;
- /* We will later output the initializer, so we can reffer to it.
+ /* We will later output the initializer, so we can refer to it.
So we are concerned only when DECL comes from initializer of
external var. */
if (!from_decl
|| TREE_CODE (from_decl) != VAR_DECL
|| !DECL_EXTERNAL (from_decl)
- || (symtab_get_node (from_decl)->symbol.in_other_partition))
+ || (flag_ltrans
+ && symtab_get_node (from_decl)->symbol.in_other_partition))
return true;
- /* We are concerned ony about static/external vars and functions. */
+ /* We are concerned only about static/external vars and functions. */
if ((!TREE_STATIC (decl) && !DECL_EXTERNAL (decl))
|| (TREE_CODE (decl) != VAR_DECL && TREE_CODE (decl) != FUNCTION_DECL))
return true;
- /* Weakrefs have somewhat confusing DECL_EXTERNAL flag set; they are always safe. */
+ /* Weakrefs have somewhat confusing DECL_EXTERNAL flag set; they
+ are always safe. */
if (DECL_EXTERNAL (decl)
&& lookup_attribute ("weakref", DECL_ATTRIBUTES (decl)))
return true;