diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d5db6ccf7d6..7b966f98a19 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2002-01-22 Janis Johnson + * Makefile.in (loop.o): Depend on OPTABS_H. + * loop.c (expand_builtin_prefetch): Check the prefetch operand + against the predicate. + PR target/5379 * config/i386/i386.md (prefetch_sse): Specify "p" as a constraint for the address operand. diff --git a/gcc/Makefile.in b/gcc/Makefile.in index ab4ad8a3096..124e589d333 100644 --- a/gcc/Makefile.in +++ b/gcc/Makefile.in @@ -1470,7 +1470,7 @@ profile.o : profile.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) $(TREE_H) flags.h \ loop.o : loop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \ insn-config.h $(REGS_H) hard-reg-set.h $(RECOG_H) $(EXPR_H) \ real.h $(PREDICT_H) $(BASIC_BLOCK_H) function.h \ - toplev.h varray.h except.h cselib.h $(TM_P_H) + toplev.h varray.h except.h cselib.h $(OPTABS_H) $(TM_P_H) doloop.o : doloop.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) flags.h $(LOOP_H) \ $(EXPR_H) hard-reg-set.h $(BASIC_BLOCK_H) $(TM_P_H) toplev.h unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) $(RTL_H) insn-config.h function.h \ diff --git a/gcc/loop.c b/gcc/loop.c index 177efb3734c..1f2a5f31180 100644 --- a/gcc/loop.c +++ b/gcc/loop.c @@ -54,6 +54,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "toplev.h" #include "predict.h" #include "insn-flags.h" +#include "optabs.h" /* Not really meaningful values, but at least something. */ #ifndef SIMULTANEOUS_PREFETCHES @@ -4019,6 +4020,10 @@ emit_prefetch_instructions (loop) loc = reg; } + /* Make sure the address operand is valid for prefetch. */ + if (! (*insn_data[(int)CODE_FOR_prefetch].operand[0].predicate) + (loc, Pmode)) + loc = force_reg (Pmode, loc); emit_insn_before (gen_prefetch (loc, GEN_INT (info[i].write), GEN_INT (3)), before_insn);