diff options
author | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-01-30 11:28:37 +0000 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2004-01-30 11:28:37 +0000 |
commit | 048b0d2ef95ac9432d33e780f0e6d3337e966244 (patch) | |
tree | 73cec5c623e50233779dbc24a86aa5650a30803f /gcc/reload.c | |
parent | 1f2eae8da546be392626ab4d9da1fdc1364b95fd (diff) | |
download | gcc-048b0d2ef95ac9432d33e780f0e6d3337e966244.zip gcc-048b0d2ef95ac9432d33e780f0e6d3337e966244.tar.gz gcc-048b0d2ef95ac9432d33e780f0e6d3337e966244.tar.bz2 |
reload.c (secondary_memlocs_elim_used): New static variable.
* reload.c (secondary_memlocs_elim_used): New static variable.
(get_secondary_mem): Update it.
(find_reloads): Use it.
From-SVN: r76950
Diffstat (limited to 'gcc/reload.c')
-rw-r--r-- | gcc/reload.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/reload.c b/gcc/reload.c index c1f2af9..83aa8d2 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 |