diff options
author | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-17 11:16:00 +0000 |
---|---|---|
committer | bernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-17 11:16:00 +0000 |
commit | 43165fe4e5cdb3c9fe27cd8fb87a577b33f291ee (patch) | |
tree | 134ce3aa4098037a175571e45c5fbc2d2a49bbd1 /gcc/reload1.c | |
parent | 776274ce5365282eb56797ba85a14102d09db061 (diff) | |
download | gcc-43165fe4e5cdb3c9fe27cd8fb87a577b33f291ee.tar.gz |
* function.c (try_fit_stack_local, add_frame_space): New static
functions.
(assign_stack_local_1): Use them. Look for opportunities to use
space previously wasted on alignment.
* function.h (struct frame_space): New.
(struct rtl_data): Add FRAME_SPACE_LIST member.
* reload1.c (something_was_spilled): New static variable.
(alter_reg): Set it.
(reload): Test it in addition to testing if the frame size changed.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159480 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/reload1.c')
-rw-r--r-- | gcc/reload1.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gcc/reload1.c b/gcc/reload1.c index ce0b602a7cf..4321b08546b 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -702,6 +702,8 @@ has_nonexceptional_receiver (void) static int something_needs_elimination; /* Set during calculate_needs if an insn needs an operand changed. */ static int something_needs_operands_changed; +/* Set by alter_regs if we spilled a register to the stack. */ +static bool something_was_spilled; /* Nonzero means we couldn't get enough spill regs. */ static int failure; @@ -981,6 +983,7 @@ reload (rtx first, int global) HOST_WIDE_INT starting_frame_size; starting_frame_size = get_frame_size (); + something_was_spilled = false; set_initial_elim_offsets (); set_initial_label_offsets (); @@ -1046,7 +1049,7 @@ reload (rtx first, int global) setup_save_areas (); /* If we allocated another stack slot, redo elimination bookkeeping. */ - if (starting_frame_size != get_frame_size ()) + if (something_was_spilled || starting_frame_size != get_frame_size ()) continue; if (starting_frame_size && crtl->stack_alignment_needed) { @@ -1084,7 +1087,7 @@ reload (rtx first, int global) /* If we allocated any new memory locations, make another pass since it might have changed elimination offsets. */ - if (starting_frame_size != get_frame_size ()) + if (something_was_spilled || starting_frame_size != get_frame_size ()) something_changed = 1; /* Even if the frame size remained the same, we might still have @@ -2223,6 +2226,8 @@ alter_reg (int i, int from_reg, bool dont_share_p) unsigned int min_align = reg_max_ref_width[i] * BITS_PER_UNIT; int adjust = 0; + something_was_spilled = true; + if (ira_conflicts_p) { /* Mark the spill for IRA. */ |