aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2012-06-15 14:40:38 +0000
committerMichael Matz <matz@gcc.gnu.org>2012-06-15 14:40:38 +0000
commit6da8be895c345e90cec9a70fdeb38111fc48a880 (patch)
tree97534b2183367e8929d27bfc21c1ffdec14eb2a6 /gcc/gimple-fold.c
parentef5ad3b74564ef8039552d4d4e8098569fef3355 (diff)
downloadgcc-6da8be895c345e90cec9a70fdeb38111fc48a880.zip
gcc-6da8be895c345e90cec9a70fdeb38111fc48a880.tar.gz
gcc-6da8be895c345e90cec9a70fdeb38111fc48a880.tar.bz2
gimplify.c (gimplify_modify_expr): Fold generated statements.
* 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. From-SVN: r188664
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 b2bd337..08e9603 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;