From: hubicka Date: Fri, 30 Jan 2004 11:28:37 +0000 (+0000) Subject: * reload.c (secondary_memlocs_elim_used): New static variable. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=605e65d94842fcee1361eade4b0946d17b7e4a00;p=thirdparty%2Fgcc.git * reload.c (secondary_memlocs_elim_used): New static variable. (get_secondary_mem): Update it. (find_reloads): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@76950 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/reload.c b/gcc/reload.c index c1f2af94500e..83aa8d24f0f8 100644 --- a/gcc/reload.c +++ b/gcc/reload.c @@ -173,6 +173,7 @@ struct decomposition static rtx secondary_memlocs[NUM_MACHINE_MODES]; static rtx secondary_memlocs_elim[NUM_MACHINE_MODES][MAX_RECOG_OPERANDS]; +static int secondary_memlocs_elim_used = 0; #endif /* The instruction we are doing reloads for; @@ -644,6 +645,8 @@ get_secondary_mem (rtx x ATTRIBUTE_UNUSED, enum machine_mode mode, } secondary_memlocs_elim[(int) mode][opnum] = loc; + if (secondary_memlocs_elim_used <= opnum) + secondary_memlocs_elim_used = opnum + 1; return loc; } @@ -2540,7 +2543,12 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known, /* The eliminated forms of any secondary memory locations are per-insn, so clear them out here. */ - memset (secondary_memlocs_elim, 0, sizeof secondary_memlocs_elim); + if (secondary_memlocs_elim_used) + { + memset (secondary_memlocs_elim, 0, + sizeof (secondary_memlocs_elim[0]) * secondary_memlocs_elim_used); + secondary_memlocs_elim_used = 0; + } #endif /* Dispose quickly of (set (reg..) (reg..)) if both have hard regs and it