From f4d3e7fd81b4e592fd85e12697fe5ea1c5e23cc5 Mon Sep 17 00:00:00 2001 From: Bob Wilson Date: Tue, 25 Mar 2008 17:56:31 +0000 Subject: [PATCH] xtensa.c (xtensa_va_start): Use build_int_cst instead of size_int for integer types. * config/xtensa/xtensa.c (xtensa_va_start): Use build_int_cst instead of size_int for integer types. (xtensa_gimplify_va_arg_expr): Likewise. Convert index to sizetype to match type of MINUS_EXPR. From-SVN: r133525 --- gcc/ChangeLog | 7 +++++++ gcc/config/xtensa/xtensa.c | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4de42338c04..39b6058029b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2008-03-25 Bob Wilson + + * config/xtensa/xtensa.c (xtensa_va_start): Use build_int_cst + instead of size_int for integer types. + (xtensa_gimplify_va_arg_expr): Likewise. Convert index to sizetype + to match type of MINUS_EXPR. + 2008-03-25 Tom Tromey * configure: Rebuilt. diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c index 2fb0d345651..7340ba766b1 100644 --- a/gcc/config/xtensa/xtensa.c +++ b/gcc/config/xtensa/xtensa.c @@ -2542,7 +2542,7 @@ xtensa_va_start (tree valist, rtx nextarg ATTRIBUTE_UNUSED) if (arg_words >= MAX_ARGS_IN_REGISTERS) arg_words += 2; t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, ndx, - size_int (arg_words * UNITS_PER_WORD)); + build_int_cst (integer_type_node, arg_words * UNITS_PER_WORD)); TREE_SIDE_EFFECTS (t) = 1; expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL); } @@ -2607,8 +2607,10 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, { int align = MIN (TYPE_ALIGN (type), STACK_BOUNDARY) / BITS_PER_UNIT; - t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, size_int (align - 1)); - t = build2 (BIT_AND_EXPR, integer_type_node, t, size_int (-align)); + t = build2 (PLUS_EXPR, integer_type_node, orig_ndx, + build_int_cst (integer_type_node, align - 1)); + t = build2 (BIT_AND_EXPR, integer_type_node, t, + build_int_cst (integer_type_node, -align)); t = build2 (GIMPLE_MODIFY_STMT, integer_type_node, orig_ndx, t); gimplify_and_add (t, pre_p); } @@ -2639,7 +2641,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, lab_over = create_artificial_label (); t = build2 (GT_EXPR, boolean_type_node, ndx, - size_int (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); + build_int_cst (integer_type_node, + MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); t = build3 (COND_EXPR, void_type_node, t, build1 (GOTO_EXPR, void_type_node, lab_false), NULL_TREE); @@ -2669,7 +2672,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, lab_false2 = create_artificial_label (); t = build2 (GT_EXPR, boolean_type_node, orig_ndx, - size_int (MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); + build_int_cst (integer_type_node, + MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD)); t = build3 (COND_EXPR, void_type_node, t, build1 (GOTO_EXPR, void_type_node, lab_false2), NULL_TREE); @@ -2714,7 +2718,8 @@ xtensa_gimplify_va_arg_expr (tree valist, tree type, tree *pre_p, else size = va_size; - t = build2 (MINUS_EXPR, sizetype, ndx, size); + t = fold_convert (sizetype, ndx); + t = build2 (MINUS_EXPR, sizetype, t, size); addr = build2 (POINTER_PLUS_EXPR, ptr_type_node, array, t); addr = fold_convert (build_pointer_type (type), addr); -- 2.30.2