summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-18 12:32:11 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2006-04-18 12:32:11 +0000
commit84aacb407a5cc753b4341edca0ccaa61e3ef5d68 (patch)
treecad6dcd18e053b0942232163fd9d1917b95533ef
parent53315a0cca0bdd12f797a2b34aeaac037a9e864a (diff)
downloadppe42-gcc-84aacb407a5cc753b4341edca0ccaa61e3ef5d68.tar.gz
ppe42-gcc-84aacb407a5cc753b4341edca0ccaa61e3ef5d68.zip
* function.c (temp_slots_at_level, max_slot_level): Use VEC
instead of VARRAY. * function.h (temp_slot_p): New. (function): Change the type of x_used_temp_slots to VEC(temp_slot_p,gc) *. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@113029 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/function.c18
-rw-r--r--gcc/function.h8
3 files changed, 26 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ef70037eeb9..8bdd0dd37ee 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2006-04-18 Kazu Hirata <kazu@codesourcery.com>
+
+ * function.c (temp_slots_at_level, max_slot_level): Use VEC
+ instead of VARRAY.
+ * function.h (temp_slot_p): New.
+ (function): Change the type of x_used_temp_slots to
+ VEC(temp_slot_p,gc) *.
+
2006-04-18 Nick Clifton <nickc@redhat.com>
* config/mmix/mmix.h (OPTIMIZATION_OPTIONS): Remove reference to
diff --git a/gcc/function.c b/gcc/function.c
index 26c99fa9e56..cc50f50777d 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -546,14 +546,18 @@ insert_slot_to_list (struct temp_slot *temp, struct temp_slot **list)
static struct temp_slot **
temp_slots_at_level (int level)
{
+ if (level >= (int) VEC_length (temp_slot_p, used_temp_slots))
+ {
+ size_t old_length = VEC_length (temp_slot_p, used_temp_slots);
+ temp_slot_p *p;
- if (!used_temp_slots)
- VARRAY_GENERIC_PTR_INIT (used_temp_slots, 3, "used_temp_slots");
-
- while (level >= (int) VARRAY_ACTIVE_SIZE (used_temp_slots))
- VARRAY_PUSH_GENERIC_PTR (used_temp_slots, NULL);
+ VEC_safe_grow (temp_slot_p, gc, used_temp_slots, level + 1);
+ p = VEC_address (temp_slot_p, used_temp_slots);
+ memset (&p[old_length], 0,
+ sizeof (temp_slot_p) * (level + 1 - old_length));
+ }
- return (struct temp_slot **) &VARRAY_GENERIC_PTR (used_temp_slots, level);
+ return &(VEC_address (temp_slot_p, used_temp_slots)[level]);
}
/* Returns the maximal temporary slot level. */
@@ -564,7 +568,7 @@ max_slot_level (void)
if (!used_temp_slots)
return -1;
- return VARRAY_ACTIVE_SIZE (used_temp_slots) - 1;
+ return VEC_length (temp_slot_p, used_temp_slots) - 1;
}
/* Moves temporary slot TEMP to LEVEL. */
diff --git a/gcc/function.h b/gcc/function.h
index 859709f609c..bce52909aeb 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -159,6 +159,12 @@ struct expr_status GTY(())
#define forced_labels (cfun->expr->x_forced_labels)
#define stack_pointer_delta (cfun->expr->x_stack_pointer_delta)
+struct temp_slot;
+typedef struct temp_slot *temp_slot_p;
+
+DEF_VEC_P(temp_slot_p);
+DEF_VEC_ALLOC_P(temp_slot_p,gc);
+
/* This structure can save all the important global and static variables
describing the status of the current function. */
@@ -266,7 +272,7 @@ struct function GTY(())
rtx x_parm_birth_insn;
/* List of all used temporaries allocated, by level. */
- struct varray_head_tag * GTY((param_is (struct temp_slot))) x_used_temp_slots;
+ VEC(temp_slot_p,gc) *x_used_temp_slots;
/* List of available temp slots. */
struct temp_slot *x_avail_temp_slots;
OpenPOWER on IntegriCloud