+2013-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ 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.
+
2013-01-13 Terry Guo <terry.guo@arm.com>
* gcc/Makefile.in (s-mlib): New argument MULTILIB_REUSE.
2013-01-10 Vladimir Makarov <vmakarov@redhat.com>
- PR rtl-optimization/pr55672
+ PR rtl-optimization/55672
* lra-eliminations.c (mark_not_eliminable): Permit addition with
const to be eliminable.
+2013-01-13 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/55935
+ * trans-expr.c (gfc_conv_structure): Call
+ unshare_expr_without_location on the ctor elements.
+
2013-01-13 Paul Thomas <pault@gcc.gnu.org>
PR fortran/54286
gfc_symbol *vtabs;
vtabs = cm->initializer->symtree->n.sym;
vtab = gfc_build_addr_expr (NULL_TREE, gfc_get_symbol_decl (vtabs));
+ vtab = unshare_expr_without_location (vtab);
CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, vtab);
}
else if (cm->ts.u.derived && strcmp (cm->name, "_size") == 0)
TREE_TYPE (cm->backend_decl),
cm->attr.dimension, cm->attr.pointer,
cm->attr.proc_pointer);
+ val = unshare_expr_without_location (val);
/* Append it to the constructor list. */
CONSTRUCTOR_APPEND_ELT (v, cm->backend_decl, val);
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
}
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. */
/* 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. */
&& 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);