summaryrefslogtreecommitdiff
path: root/gcc/function.c
diff options
context:
space:
mode:
authorrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-13 11:21:23 +0000
committerrakdver <rakdver@138bc75d-0d04-0410-961f-82ee72b054a4>2006-02-13 11:21:23 +0000
commit867eb367b050221585bf34ee6d40da0caecba19b (patch)
tree934621970c423e615e444a8421dba6db457cfcfb /gcc/function.c
parent36c61b5578e113d5c199b0c5708e3e04d23af115 (diff)
downloadgcc-867eb367b050221585bf34ee6d40da0caecba19b.tar.gz
PR rtl-optimization/26222
* function.c (assign_stack_temp_for_type): Do not reuse stack slots after tree->rtl expansion. * loop-invariant.c (move_invariant_reg): Use force_operand on rhs before passing it to emit_move_insn. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110912 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/function.c')
-rw-r--r--gcc/function.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/gcc/function.c b/gcc/function.c
index 61ee42127ad..00a673ac4bd 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -625,22 +625,30 @@ assign_stack_temp_for_type (enum machine_mode mode, HOST_WIDE_INT size,
/* Try to find an available, already-allocated temporary of the proper
mode which meets the size and alignment requirements. Choose the
- smallest one with the closest alignment. */
- for (p = avail_temp_slots; p; p = p->next)
+ smallest one with the closest alignment.
+
+ If assign_stack_temp is called outside of the tree->rtl expansion,
+ we cannot reuse the stack slots (that may still refer to
+ VIRTUAL_STACK_VARS_REGNUM). */
+ if (!virtuals_instantiated)
{
- if (p->align >= align && p->size >= size && GET_MODE (p->slot) == mode
- && objects_must_conflict_p (p->type, type)
- && (best_p == 0 || best_p->size > p->size
- || (best_p->size == p->size && best_p->align > p->align)))
+ for (p = avail_temp_slots; p; p = p->next)
{
- if (p->align == align && p->size == size)
+ if (p->align >= align && p->size >= size
+ && GET_MODE (p->slot) == mode
+ && objects_must_conflict_p (p->type, type)
+ && (best_p == 0 || best_p->size > p->size
+ || (best_p->size == p->size && best_p->align > p->align)))
{
- selected = p;
- cut_slot_from_list (selected, &avail_temp_slots);
- best_p = 0;
- break;
+ if (p->align == align && p->size == size)
+ {
+ selected = p;
+ cut_slot_from_list (selected, &avail_temp_slots);
+ best_p = 0;
+ break;
+ }
+ best_p = p;
}
- best_p = p;
}
}