Wed Oct 28 03:59:29 1998 Bernd Schmidt <crux@pool.informatik.rwth-aachen.de>
+ * regclass.c (renumber, regno_allocated): New static variables, moved
+ out of allocate_reg_info.
+ (allocate_reg_info): Move these two variables outside the function.
+ Move code to free memory into new function free_reg_info.
+ (free_reg_info): New function, broken out of allocate_reg_info.
+ * toplev.c (compile_file): Call free_reg_info, not allocate_reg_info.
+ * rtl.h (allocate_reg_info): Don't declare.
+ (free_reg_info): Declare.
+
* final.c (cleanup_subreg_operands): ASM_INPUTs need no treatment.
Wed Oct 28 02:38:12 1998 Jason Merrill <jason@yorick.cygnus.com>
#endif /* REGISTER_CONSTRAINTS */
\f
+static short *renumber = (short *)0;
+static size_t regno_allocated = 0;
+
/* Allocate enough space to hold NUM_REGS registers for the tables used for
reg_scan and flow_analysis that are indexed by the register number. If
NEW_P is non zero, initialize all of the registers, otherwise only
int new_p;
int renumber_p;
{
- static size_t regno_allocated = 0;
- static short *renumber = (short *)0;
size_t size_info;
size_t size_renumber;
size_t min = (new_p) ? 0 : reg_n_max;
struct reg_info_data *reg_data;
struct reg_info_data *reg_next;
- /* Free up all storage allocated */
- if (num_regs < 0)
- {
- if (reg_n_info)
- {
- VARRAY_FREE (reg_n_info);
- for (reg_data = reg_info_head; reg_data; reg_data = reg_next)
- {
- reg_next = reg_data->next;
- free ((char *)reg_data);
- }
-
- free (prefclass_buffer);
- free (altclass_buffer);
- prefclass_buffer = (char *)0;
- altclass_buffer = (char *)0;
- reg_info_head = (struct reg_info_data *)0;
- renumber = (short *)0;
- }
- regno_allocated = 0;
- reg_n_max = 0;
- return;
- }
-
if (num_regs > regno_allocated)
{
size_t old_allocated = regno_allocated;
MAX_REGNO_REG_SET (num_regs, new_p, renumber_p);
}
+/* Free up the space allocated by allocate_reg_info. */
+void
+free_reg_info ()
+{
+ if (reg_n_info)
+ {
+ struct reg_info_data *reg_data;
+ struct reg_info_data *reg_next;
+
+ VARRAY_FREE (reg_n_info);
+ for (reg_data = reg_info_head; reg_data; reg_data = reg_next)
+ {
+ reg_next = reg_data->next;
+ free ((char *)reg_data);
+ }
+
+ free (prefclass_buffer);
+ free (altclass_buffer);
+ prefclass_buffer = (char *)0;
+ altclass_buffer = (char *)0;
+ reg_info_head = (struct reg_info_data *)0;
+ renumber = (short *)0;
+ }
+ regno_allocated = 0;
+ reg_n_max = 0;
+}
\f
/* This is the `regscan' pass of the compiler, run just before cse
and again just before loop.