1 --- gcc/gcc/gimplify.c 20 Jul 2005 01:18:18 -0000 2.142
2 +++ gcc/gcc/gimplify.c 24 Jul 2005 10:10:35 -0000
8 +gimplify_build_fold_addr_expr (tree t)
10 + if (TREE_CODE (t) == CONSTRUCTOR)
14 + = create_tmp_var (TREE_TYPE (t), "ATP");
15 + TREE_ADDRESSABLE (new_var) = 1;
16 + TREE_READONLY (new_var) = 1;
17 + DECL_INITIAL (new_var) = t;
18 + new_t = build1 (DECL_EXPR, void_type_node, new_var);
19 + t = build_fold_addr_expr (new_var);
20 + t = build2 (COMPOUND_EXPR, TREE_TYPE (t), new_t, t);
23 + return build_fold_addr_expr (t);
26 /* Create a new temporary name with PREFIX. Returns an identifier. */
28 static GTY(()) unsigned int tmp_var_id_num;
29 @@ -3224,9 +3243,10 @@
31 t = SUBSTITUTE_PLACEHOLDER_IN_EXPR (t, op0);
32 args = tree_cons (NULL, t, NULL);
33 - t = build_fold_addr_expr (op1);
35 + t = gimplify_build_fold_addr_expr (op1);
36 args = tree_cons (NULL, t, args);
37 - dest = build_fold_addr_expr (op0);
38 + dest = gimplify_build_fold_addr_expr (op0);
39 args = tree_cons (NULL, dest, args);
40 t = implicit_built_in_decls[BUILT_IN_MEMCMP];
41 t = build_function_call_expr (t, args);
43 op0 = TREE_OPERAND (op0, 0);
45 *expr_p = fold_convert (TREE_TYPE (expr),
46 - build_fold_addr_expr (TREE_OPERAND (op0, 0)));
47 + gimplify_build_fold_addr_expr (TREE_OPERAND (op0, 0)));
52 /* An lvalue will do. Take the address of the expression, store it
53 in a temporary, and replace the expression with an INDIRECT_REF of
55 - tmp = build_fold_addr_expr (*expr_p);
56 + tmp = gimplify_build_fold_addr_expr (*expr_p);
57 gimplify_expr (&tmp, pre_p, post_p, is_gimple_reg, fb_rvalue);
58 *expr_p = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (tmp)), tmp);
60 --- gcc/gcc/ada/trans.c 20 Jul 2005 01:18:53 -0000 1.101
61 +++ gcc/gcc/ada/trans.c 24 Jul 2005 10:10:37 -0000
64 gnu_lhs = DECL_RESULT (current_function_decl);
67 /* Do not remove the padding from GNU_RET_VAL if the inner
68 type is self-referential since we want to allocate the fixed
71 && (CONTAINS_PLACEHOLDER_P
72 (TYPE_SIZE (TREE_TYPE (gnu_ret_val)))))
73 gnu_ret_val = TREE_OPERAND (gnu_ret_val, 0);
76 if (TYPE_RETURNS_BY_REF_P (gnu_subprog_type)
77 || By_Ref (gnat_node))
78 @@ -4549,28 +4551,6 @@
79 *expr_p = TREE_OPERAND (*expr_p, 0);
83 - /* If we're taking the address of a constant CONSTRUCTOR, force it to
84 - be put into static memory. We know it's going to be readonly given
85 - the semantics we have and it's required to be static memory in
86 - the case when the reference is in an elaboration procedure. */
87 - if (TREE_CODE (TREE_OPERAND (expr, 0)) == CONSTRUCTOR
88 - && TREE_CONSTANT (TREE_OPERAND (expr, 0)))
91 - = create_tmp_var (TREE_TYPE (TREE_OPERAND (expr, 0)), "C");
93 - TREE_READONLY (new_var) = 1;
94 - TREE_STATIC (new_var) = 1;
95 - TREE_ADDRESSABLE (new_var) = 1;
96 - DECL_INITIAL (new_var) = TREE_OPERAND (expr, 0);
98 - TREE_OPERAND (expr, 0) = new_var;
99 - recompute_tree_invarant_for_addr_expr (expr);
100 - return GS_ALL_DONE;
102 - return GS_UNHANDLED;
105 /* We have a kludge here. If the FIELD_DECL is from a fat pointer and is
106 from an early dummy type, replace it with the proper FIELD_DECL. */
107 @@ -5361,7 +5341,7 @@
109 case UNCONSTRAINED_ARRAY_REF:
112 +/* case CONSTRUCTOR:*/
116 --- gcc/gcc/ada/utils2.c 20 Jul 2005 01:18:55 -0000 1.50
117 +++ gcc/gcc/ada/utils2.c 24 Jul 2005 10:10:37 -0000
120 #include "ada-tree.h"
122 +#include "tree-gimple.h"
125 static tree find_common_type (tree, tree);
126 static bool contains_save_expr_p (tree);
127 @@ -1032,6 +1034,7 @@
128 tree operation_type = result_type;
130 bool side_effects = false;
131 + tree before = NULL;
134 && TREE_CODE (operation_type) == RECORD_TYPE
135 @@ -1150,6 +1153,22 @@
141 + tree new_var = create_tmp_var_raw (type, "C");
142 + TREE_ADDRESSABLE (new_var) = 1;
143 + TREE_READONLY (new_var) = 1;
144 + if (global_bindings_p ())
145 + TREE_STATIC (new_var) = 1;
146 + DECL_INITIAL (new_var) = operand;
147 + gnat_pushdecl (new_var, Empty);
149 + if (global_bindings_p ())
150 + rest_of_decl_compilation (new_var, 1, 0);
152 + before = build1 (DECL_EXPR, void_type_node, new_var);
158 @@ -1198,6 +1217,9 @@
161 TREE_CONSTANT (result) = staticp (operand) || TREE_CONSTANT (operand);
163 + result = build2 (COMPOUND_EXPR, TREE_TYPE (result), before,