diff options
author | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-15 14:40:38 +0000 |
---|---|---|
committer | matz <matz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-06-15 14:40:38 +0000 |
commit | 8f1c7d1974f3a7f6551dcc5ce7821872f0f97d62 (patch) | |
tree | 97534b2183367e8929d27bfc21c1ffdec14eb2a6 /gcc/gimple-fold.c | |
parent | bc8c1f839fdfd8df24e947bdfc69ee588c897e08 (diff) | |
download | gcc-8f1c7d1974f3a7f6551dcc5ce7821872f0f97d62.tar.gz |
* gimplify.c (gimplify_modify_expr): Fold generated statements.
* gimple-fold.c (can_refer_decl_in_current_unit_p): Check flag_ltrans.
testsuite/
* gcc.dg/debug/dwarf2/inline3.c: Adjust.
* gcc.dg/tree-ssa/foldstring-1.c: Adjust.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@188664 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 10 |
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; |