OSDN Git Service

Uniquization of constants at the Tree level
[pf3gnuchains/gcc-fork.git] / gcc / ada / gcc-interface / trans.c
index 2e35a1f..25521a9 100644 (file)
@@ -6043,16 +6043,8 @@ gnat_gimplify_expr (tree *expr_p, gimple_seq *pre_p,
             the reference is in an elaboration procedure.  */
          if (TREE_CONSTANT (op))
            {
-             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);
+             tree addr = build_fold_addr_expr (tree_output_constant_def (op));
+             *expr_p = fold_convert (TREE_TYPE (expr), addr);
            }
 
          /* Otherwise explicitly create the local temporary.  That's required