------- Comment #6 from belyshev at depni dot sinp dot msu dot ru 2007-07-16
17:30 -------
(In reply to comment #5)
You need the following patch to fix this bug (but bootstrap on alpha is still
broken for other reasons, see bug 32747):
---
gcc/config/alpha/alpha.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
Index: gcc43/gcc/config/alpha/alpha.c
===================================================================
--- gcc43.orig/gcc/config/alpha/alpha.c
+++ gcc43/gcc/config/alpha/alpha.c
@@ -5835,7 +5835,8 @@ va_list_skip_additions (tree lhs)
if ((TREE_CODE (rhs) != NOP_EXPR
&& TREE_CODE (rhs) != CONVERT_EXPR
- && (TREE_CODE (rhs) != PLUS_EXPR
+ && ((TREE_CODE (rhs) != PLUS_EXPR
+ && TREE_CODE (rhs) != POINTER_PLUS_EXPR)
|| TREE_CODE (TREE_OPERAND (rhs, 1)) != INTEGER_CST
|| !host_integerp (TREE_OPERAND (rhs, 1), 1)))
|| TREE_CODE (TREE_OPERAND (rhs, 0)) != SSA_NAME)
@@ -5877,7 +5878,7 @@ alpha_stdarg_optimize_hook (struct stdar
lhs = va_list_skip_additions (TREE_OPERAND (rhs, 0));
if (lhs == NULL_TREE
- || TREE_CODE (lhs) != PLUS_EXPR)
+ || TREE_CODE (lhs) != POINTER_PLUS_EXPR)
return false;
base = TREE_OPERAND (lhs, 0);
@@ -6111,8 +6112,8 @@ alpha_va_start (tree valist, rtx nextarg
valist, offset_field, NULL_TREE);
t = make_tree (ptr_type_node, virtual_incoming_args_rtx);
- t = build2 (PLUS_EXPR, ptr_type_node, t,
- build_int_cst (NULL_TREE, offset));
+ t = build2 (POINTER_PLUS_EXPR, ptr_type_node, t,
+ size_int (offset));
t = build2 (GIMPLE_MODIFY_STMT, TREE_TYPE (base_field), base_field, t);
TREE_SIDE_EFFECTS (t) = 1;
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
@@ -6172,8 +6173,8 @@ alpha_gimplify_va_arg_1 (tree type, tree
}
/* Build the final address and force that value into a temporary. */
- addr = build2 (PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
- fold_convert (ptr_type, addend));
+ addr = build2 (POINTER_PLUS_EXPR, ptr_type, fold_convert (ptr_type, base),
+ fold_convert (sizetype, addend));
internal_post = NULL;
gimplify_expr (&addr, pre_p, &internal_post, is_gimple_val, fb_rvalue);
append_to_statement_list (internal_post, pre_p);
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32522