1 --- gcc/gcc/ada/trans.c (revision 107434)
2 +++ gcc/gcc/ada/trans.c (working copy)
3 @@ -4570,7 +4570,6 @@ int
4 gnat_gimplify_expr (tree *expr_p, tree *pre_p, tree *post_p ATTRIBUTE_UNUSED)
9 if (IS_ADA_STMT (expr))
10 return gnat_gimplify_stmt (expr_p);
11 @@ -4600,53 +4599,6 @@ gnat_gimplify_expr (tree *expr_p, tree *
12 *expr_p = TREE_OPERAND (*expr_p, 0);
16 - op = TREE_OPERAND (expr, 0);
18 - /* If we're taking the address of a constant CONSTRUCTOR, force it to
19 - be put into static memory. We know it's going to be readonly given
20 - the semantics we have and it's required to be static memory in
21 - the case when the reference is in an elaboration procedure. */
22 - if (TREE_CODE (op) == CONSTRUCTOR && TREE_CONSTANT (op))
24 - tree new_var = create_tmp_var (TREE_TYPE (op), "C");
26 - TREE_READONLY (new_var) = 1;
27 - TREE_STATIC (new_var) = 1;
28 - TREE_ADDRESSABLE (new_var) = 1;
29 - DECL_INITIAL (new_var) = op;
31 - TREE_OPERAND (expr, 0) = new_var;
32 - recompute_tree_invarant_for_addr_expr (expr);
36 - /* Otherwise, if we are taking the address of something that is neither
37 - reference, declaration, or constant, make a variable for the operand
38 - here and then take its address. If we don't do it this way, we may
39 - confuse the gimplifier because it needs to know the variable is
40 - addressable at this point. This duplicates code in
41 - internal_get_tmp_var, which is unfortunate. */
42 - else if (TREE_CODE_CLASS (TREE_CODE (op)) != tcc_reference
43 - && TREE_CODE_CLASS (TREE_CODE (op)) != tcc_declaration
44 - && TREE_CODE_CLASS (TREE_CODE (op)) != tcc_constant)
46 - tree new_var = create_tmp_var (TREE_TYPE (op), "A");
47 - tree mod = build (MODIFY_EXPR, TREE_TYPE (op), new_var, op);
49 - TREE_ADDRESSABLE (new_var) = 1;
51 - if (EXPR_HAS_LOCATION (op))
52 - SET_EXPR_LOCUS (mod, EXPR_LOCUS (op));
54 - gimplify_and_add (mod, pre_p);
55 - TREE_OPERAND (expr, 0) = new_var;
56 - recompute_tree_invarant_for_addr_expr (expr);
60 - return GS_UNHANDLED;
63 /* We have a kludge here. If the FIELD_DECL is from a fat pointer and is
64 from an early dummy type, replace it with the proper FIELD_DECL. */
65 @@ -5436,7 +5388,6 @@ addressable_p (tree gnu_expr)
67 case UNCONSTRAINED_ARRAY_REF:
73 --- gcc/gcc/ada/utils2.c (revision 107414)
74 +++ gcc/gcc/ada/utils2.c (working copy)
79 +#include "tree-gimple.h"
82 static tree find_common_type (tree, tree);
83 static bool contains_save_expr_p (tree);
84 @@ -998,6 +1000,7 @@ build_unary_op (enum tree_code op_code,
85 tree operation_type = result_type;
87 bool side_effects = false;
91 && TREE_CODE (operation_type) == RECORD_TYPE
92 @@ -1116,6 +1119,22 @@ build_unary_op (enum tree_code op_code,
98 + /* Create a temporary variable to hold the CONSTRUCTON. */
99 + tree new_var = create_tmp_var_raw (type, "C");
100 + TREE_ADDRESSABLE (new_var) = 1;
101 + TREE_READONLY (new_var) = 1;
102 + if (global_bindings_p ())
103 + TREE_STATIC (new_var) = 1;
104 + DECL_INITIAL (new_var) = operand;
105 + gnat_pushdecl (new_var, Empty);
106 + if (global_bindings_p ())
107 + rest_of_decl_compilation (new_var, 1, 0);
109 + before = build1 (DECL_EXPR, void_type_node, new_var);
115 @@ -1170,6 +1189,9 @@ build_unary_op (enum tree_code op_code,
118 TREE_CONSTANT (result) = staticp (operand) || TREE_CONSTANT (operand);
120 + result = build2 (COMPOUND_EXPR, TREE_TYPE (result), before,
125 @@ -2003,10 +2025,6 @@ gnat_mark_addressable (tree expr_node)
126 expr_node = TREE_OPERAND (expr_node, 0);
130 - TREE_ADDRESSABLE (expr_node) = 1;
136 --- gcc/gcc/ada/Makefile.in.orig 2005-11-23 16:48:27.000000000 +0000
137 +++ gcc/gcc/ada/Makefile.in 2005-11-24 10:14:25.987115520 +0000
138 @@ -1899,6 +1899,12 @@
139 $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O2 $(ADA_INCLUDES) \
142 +# [Bug ada/22533] [4.1/4.2 regression] Ada ICE during bootstrap on many platforms
144 +make.o : make.adb make.ads
145 + $(CC) -c $(ALL_ADAFLAGS) $(FORCE_DEBUG_ADAFLAGS) -O1 $(ADA_INCLUDES) \
146 + $< $(OUTPUT_OPTION)
148 adadecode.o : adadecode.c adadecode.h