From 95899b34957e97c03851efb4d482f3efe53a68f9 Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Mon, 26 Jul 2004 10:51:21 -0700 Subject: [PATCH] calls.c (combine_pending_stack_adjustment_and_call): Make preferred_unit_stack_boundary argument unsigned. * calls.c (combine_pending_stack_adjustment_and_call): Make preferred_unit_stack_boundary argument unsigned. Make unadjusted_alignment unsigned. (expand_call): Make preferred_stack_boundary and preferred_unit_stack_boundary variables unsigned. * function.c (assign_stack_local_1): Make alignment unsigned. * function.h (struct function): Make stack_alignment_needed, preferred_stack_boundary unsigned. * config/i386/i386.c (ix86_preferred_stack_boundary): Make unsigned. (ix86_compute_frame_layout): Make stack_alignment_needed, preferred_alignment variables unsigned. * config/i386/i386.h (ix86_preferred_stack_boundary): Make unsigned. From-SVN: r85196 --- gcc/ChangeLog | 15 +++++++++++++++ gcc/calls.c | 10 +++++----- gcc/config/i386/i386.c | 9 ++++++--- gcc/config/i386/i386.h | 2 +- gcc/function.c | 2 +- gcc/function.h | 4 ++-- 6 files changed, 30 insertions(+), 12 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 34ba0e6d177..0052cbb7322 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,18 @@ +2004-06-26 Richard Henderson + + * calls.c (combine_pending_stack_adjustment_and_call): Make + preferred_unit_stack_boundary argument unsigned. Make + unadjusted_alignment unsigned. + (expand_call): Make preferred_stack_boundary and + preferred_unit_stack_boundary variables unsigned. + * function.c (assign_stack_local_1): Make alignment unsigned. + * function.h (struct function): Make stack_alignment_needed, + preferred_stack_boundary unsigned. + * config/i386/i386.c (ix86_preferred_stack_boundary): Make unsigned. + (ix86_compute_frame_layout): Make stack_alignment_needed, + preferred_alignment variables unsigned. + * config/i386/i386.h (ix86_preferred_stack_boundary): Make unsigned. + 2004-07-26 Tom Tromey * tree.h: Fix typo in comment. diff --git a/gcc/calls.c b/gcc/calls.c index d83b419c4bb..bf90ceb1f68 100644 --- a/gcc/calls.c +++ b/gcc/calls.c @@ -143,7 +143,7 @@ static int check_sibcall_argument_overlap_1 (rtx); static int check_sibcall_argument_overlap (rtx, struct arg_data *, int); static int combine_pending_stack_adjustment_and_call (int, struct args_size *, - int); + unsigned int); static tree fix_unsafe_tree (tree); static bool shift_returned_value (tree, rtx *); @@ -1582,14 +1582,14 @@ load_register_parameters (struct arg_data *args, int num_actuals, static int combine_pending_stack_adjustment_and_call (int unadjusted_args_size, struct args_size *args_size, - int preferred_unit_stack_boundary) + unsigned int preferred_unit_stack_boundary) { /* The number of bytes to pop so that the stack will be under-aligned by UNADJUSTED_ARGS_SIZE bytes. */ HOST_WIDE_INT adjustment; /* The alignment of the stack after the arguments are pushed, if we just pushed the arguments without adjust the stack here. */ - HOST_WIDE_INT unadjusted_alignment; + unsigned HOST_WIDE_INT unadjusted_alignment; unadjusted_alignment = ((stack_pointer_delta + unadjusted_args_size) @@ -1968,9 +1968,9 @@ expand_call (tree exp, rtx target, int ignore) tree addr = TREE_OPERAND (exp, 0); int i; /* The alignment of the stack, in bits. */ - HOST_WIDE_INT preferred_stack_boundary; + unsigned HOST_WIDE_INT preferred_stack_boundary; /* The alignment of the stack, in bytes. */ - HOST_WIDE_INT preferred_unit_stack_boundary; + unsigned HOST_WIDE_INT preferred_unit_stack_boundary; /* The static chain value to use for this call. */ rtx static_chain_value; /* See if this is "nothrow" function call. */ diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index 4b17cfb4396..de3edbe2274 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -819,7 +819,7 @@ const char *ix86_align_jumps_string; const char *ix86_preferred_stack_boundary_string; /* Preferred alignment for stack boundary in bits. */ -int ix86_preferred_stack_boundary; +unsigned int ix86_preferred_stack_boundary; /* Values 1-5: see jump.c */ int ix86_branch_cost; @@ -5084,14 +5084,17 @@ static void ix86_compute_frame_layout (struct ix86_frame *frame) { HOST_WIDE_INT total_size; - int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT; + unsigned int stack_alignment_needed; HOST_WIDE_INT offset; - int preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT; + unsigned int preferred_alignment; HOST_WIDE_INT size = get_frame_size (); frame->nregs = ix86_nsaved_regs (); total_size = size; + stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT; + preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT; + /* During reload iteration the amount of registers saved can change. Recompute the value as needed. Do not recompute when amount of registers didn't change as reload does mutiple calls to the function and does not diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index da73bfefcd9..40bf959d81f 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2981,7 +2981,7 @@ extern enum asm_dialect ix86_asm_dialect; extern int ix86_regparm; extern const char *ix86_regparm_string; -extern int ix86_preferred_stack_boundary; +extern unsigned int ix86_preferred_stack_boundary; extern const char *ix86_preferred_stack_boundary_string; extern int ix86_branch_cost; diff --git a/gcc/function.c b/gcc/function.c index 20c5c5c3fb6..2d4ace5cff2 100644 --- a/gcc/function.c +++ b/gcc/function.c @@ -395,7 +395,7 @@ assign_stack_local_1 (enum machine_mode mode, HOST_WIDE_INT size, int align, { rtx x, addr; int bigend_correction = 0; - int alignment; + unsigned int alignment; int frame_off, frame_alignment, frame_phase; if (align == 0) diff --git a/gcc/function.h b/gcc/function.h index 8b25793498a..60baf84e12d 100644 --- a/gcc/function.h +++ b/gcc/function.h @@ -304,9 +304,9 @@ struct function GTY(()) /* tm.h can use this to store whatever it likes. */ struct machine_function * GTY ((maybe_undef)) machine; /* The largest alignment of slot allocated on the stack. */ - int stack_alignment_needed; + unsigned int stack_alignment_needed; /* Preferred alignment of the end of stack frame. */ - int preferred_stack_boundary; + unsigned int preferred_stack_boundary; /* Set when the call to function itself has been emit. */ bool recursive_call_emit; /* Set when the tail call has been produced. */ -- 2.30.2