PATCH: Fix loop.c for targets without HAVE_prefetch
H . J . Lu
hjl@lucon.org
Wed Jan 23 12:15:00 GMT 2002
On Wed, Jan 23, 2002 at 12:23:45AM -0500, John David Anglin wrote:
> > > This patch
> > >
> > > http://gcc.gnu.org/ml/gcc-patches/2002-01/msg01393.html
>
> causes a new warning when PREFETCH_NOT_ALWAYS is 0:
>
> ../../gcc/gcc/loop.c:3573: warning: `check_store' defined but not used
>
Here is a new patch.
H.J.
----
2002-01-23 H.J. Lu (hjl@gnu.org)
* loop.c (HAVE_prefetch): Don't define if not defined.
(CODE_FOR_prefetch): Removed.
(gen_prefetch): Removed.
(check_store): Define only if HAVE_prefetch is
defined.
(emit_prefetch_instructions): Likewise.
(rtx_equal_for_prefetch_p): Likewise.
(remove_constant_addition): Likewise.
--- gcc/loop.c.prefetch Wed Jan 23 09:00:37 2002
+++ gcc/loop.c Wed Jan 23 12:08:49 2002
@@ -63,11 +63,6 @@ Software Foundation, 59 Temple Place - S
#ifndef PREFETCH_BLOCK
#define PREFETCH_BLOCK 32
#endif
-#ifndef HAVE_prefetch
-#define HAVE_prefetch 0
-#define CODE_FOR_prefetch 0
-#define gen_prefetch(a,b,c) (abort(), NULL_RTX)
-#endif
/* Give up the prefetch optimizations once we exceed a given threshhold.
It is unlikely that we would be able to optimize something in a loop
@@ -352,7 +347,6 @@ static rtx loop_insn_sink_or_swim PARAMS
static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int));
static void loop_delete_insns PARAMS ((rtx, rtx));
-static HOST_WIDE_INT remove_constant_addition PARAMS ((rtx *));
void debug_ivs PARAMS ((const struct loop *));
void debug_iv_class PARAMS ((const struct iv_class *));
void debug_biv PARAMS ((const struct induction *));
@@ -3566,6 +3560,8 @@ struct check_store_data
int mem_write;
};
+#ifdef HAVE_prefetch
+static HOST_WIDE_INT remove_constant_addition PARAMS ((rtx *));
static void check_store PARAMS ((rtx, rtx, void *));
static void emit_prefetch_instructions PARAMS ((struct loop *));
static int rtx_equal_for_prefetch_p PARAMS ((rtx, rtx));
@@ -4069,6 +4065,7 @@ emit_prefetch_instructions (loop)
return;
}
+#endif
/* A "basic induction variable" or biv is a pseudo reg that is set
(within this loop) only by incrementing or decrementing it. */
More information about the Gcc-patches
mailing list