This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
haifa-sched.c : memory usage reduction
- From: "Christophe Jaillet" <christophe dot jaillet at wanadoo dot fr>
- To: <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 14 Feb 2005 00:22:33 +0100
- Subject: haifa-sched.c : memory usage reduction
Description : in gcc/haifa-sched.c, some memory allocated with alloca could
be avoided.
During a full bootstrap, more than 2 000 000 calls to alloca have been
avoided (20 bytes each time)
Bootstrapped on my i686-pc-cygwin.
2005-02-13 Christophe Jaillet <christophe.jaillet@wanadoo.fr>
* haifa-sched.c (early_queue_to_ready): delay a call to alloca to avoid
it if (! flag_sched_stalled_insns)
*** gcc-4.0-20050130/gcc/haifa-sched.c Mon Feb 14 00:18:58 2005
--- my_patch/haifa-sched.c Sun Feb 13 23:04:20 2005
*************** early_queue_to_ready (state_t state, str
*** 1502,1508 ****
rtx prev_link;
bool move_to_ready;
int cost;
! state_t temp_state = alloca (dfa_state_size);
int stalls;
int insns_removed = 0;
--- 1502,1508 ----
rtx prev_link;
bool move_to_ready;
int cost;
! state_t temp_state;
int stalls;
int insns_removed = 0;
*************** early_queue_to_ready (state_t state, str
*** 1523,1528 ****
--- 1523,1530 ----
if (! flag_sched_stalled_insns)
return 0;
+ temp_state = alloca (dfa_state_size);
+
for (stalls = 0; stalls <= max_insn_queue_index; stalls++)
{
if ((link = insn_queue[NEXT_Q_AFTER (q_ptr, stalls)]))