+2005-11-02 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR target/24600
+ * loop.c (loop_givs_rescan): Use force_operand to expand
+ complex GIVs.
+
2005-11-02 Andrew Pinski <pinskia@physics.uc.edu>
PR 22429
/* Not replaceable; emit an insn to set the original
giv reg from the reduced giv. */
else if (REG_P (*v->location))
- loop_insn_emit_before (loop, 0, v->insn,
- gen_move_insn (*v->location,
- v->new_reg));
+ {
+ rtx tem;
+ start_sequence ();
+ tem = force_operand (v->new_reg, *v->location);
+ if (tem != *v->location)
+ emit_move_insn (*v->location, tem);
+ tem = get_insns ();
+ end_sequence ();
+ loop_insn_emit_before (loop, 0, v->insn, tem);
+ }
else if (GET_CODE (*v->location) == PLUS
&& REG_P (XEXP (*v->location, 0))
&& CONSTANT_P (XEXP (*v->location, 1)))
--- /dev/null
+/* This used to ICE on s390 due to a old-loop bug. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+char *strcpy (char *dest, const char *src);
+
+void test (char *Line, int len)
+{
+ int z;
+
+ for (z = 1; z <= len; z++)
+ if (Line[z - 1])
+ strcpy (Line + z + 1, Line);
+}
+