diff options
author | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-01-13 13:33:43 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2013-01-13 13:33:43 +0100 |
commit | 9d60be386676d883d4a8bd2feaace130fb905a0f (patch) | |
tree | 190944d72880df83808c66199c3e4f272b8161d5 /gcc/gimple-fold.c | |
parent | e7f49d92ca829a0a51c1cb3ae26ebb0cb08f0fed (diff) | |
download | gcc-9d60be386676d883d4a8bd2feaace130fb905a0f.zip gcc-9d60be386676d883d4a8bd2feaace130fb905a0f.tar.gz gcc-9d60be386676d883d4a8bd2feaace130fb905a0f.tar.bz2 |
re PR fortran/55935 ([OOP] Fortran fronted has ADDR_EXPRs of FUNCTION_DECLs with bogus BLOCK)
PR fortran/55935
* gimple-fold.c (get_symbol_constant_value): Call
unshare_expr.
(fold_gimple_assign): Don't call unshare_expr here.
(fold_ctor_reference): Call unshare_expr.
* trans-expr.c (gfc_conv_structure): Call
unshare_expr_without_location on the ctor elements.
From-SVN: r195136
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index 6d38122..b9211a9 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -202,7 +202,7 @@ get_symbol_constant_value (tree sym) tree val = DECL_INITIAL (sym); if (val) { - val = canonicalize_constructor_val (val, sym); + val = canonicalize_constructor_val (unshare_expr (val), sym); if (val && is_gimple_min_invariant (val)) return val; else @@ -378,7 +378,7 @@ fold_gimple_assign (gimple_stmt_iterator *si) } else if (DECL_P (rhs)) - return unshare_expr (get_symbol_constant_value (rhs)); + return get_symbol_constant_value (rhs); /* If we couldn't fold the RHS, hand over to the generic fold routines. */ @@ -2941,7 +2941,7 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, /* We found the field with exact match. */ if (useless_type_conversion_p (type, TREE_TYPE (ctor)) && !offset) - return canonicalize_constructor_val (ctor, from_decl); + return canonicalize_constructor_val (unshare_expr (ctor), from_decl); /* We are at the end of walk, see if we can view convert the result. */ @@ -2950,7 +2950,7 @@ fold_ctor_reference (tree type, tree ctor, unsigned HOST_WIDE_INT offset, && operand_equal_p (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (ctor)), 0)) { - ret = canonicalize_constructor_val (ctor, from_decl); + ret = canonicalize_constructor_val (unshare_expr (ctor), from_decl); ret = fold_unary (VIEW_CONVERT_EXPR, type, ret); if (ret) STRIP_NOPS (ret); |