OSDN Git Service

* gcc-interface/trans.c (gnat_to_gnu) <N_Assignment_Statement>: Do not
[pf3gnuchains/gcc-fork.git] / gcc / ada / gcc-interface / trans.c
index 743a652..84fa138 100644 (file)
@@ -6036,8 +6036,16 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
             the reference is in an elaboration procedure.  */
          if (TREE_CONSTANT (op))
            {
-             tree addr = build_fold_addr_expr (tree_output_constant_def (op));
-             *expr_p = fold_convert (TREE_TYPE (expr), addr);
+             tree new_var = create_tmp_var_raw (TREE_TYPE (op), "C");
+             TREE_ADDRESSABLE (new_var) = 1;
+             gimple_add_tmp_var (new_var);
+
+             TREE_READONLY (new_var) = 1;
+             TREE_STATIC (new_var) = 1;
+             DECL_INITIAL (new_var) = op;
+
+             TREE_OPERAND (expr, 0) = new_var;
+             recompute_tree_invariant_for_addr_expr (expr);
            }
 
          /* Otherwise explicitly create the local temporary.  That's required