From 115bceb98a8ef12e2ad76bab0050eb4b57e09db6 Mon Sep 17 00:00:00 2001
From: rth <rth@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Tue, 5 Feb 2002 09:49:31 +0000
Subject: [PATCH]         PR fortran/3393         * loop.c
 (loop_iv_add_mult_emit_before): Copy multiplier as well.        
 (loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@49521 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog | 4 ++++
 gcc/loop.c    | 6 +++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 107ec4b0fbce..5f1b84ab1cdf 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,9 @@
 2002-02-05  Richard Henderson  <rth@redhat.com>
 
+	PR fortran/3393
+	* loop.c (loop_iv_add_mult_emit_before): Copy multiplier as well.
+	(loop_iv_add_mult_sink, loop_iv_add_mult_hoist): Likewise.
+
 	PR fortran/3392
 	* config/mips/mips.c (function_arg): Handle TImode.
 	(function_arg_advance): Likewise.
diff --git a/gcc/loop.c b/gcc/loop.c
index a65595f2a447..0067e7490fd4 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -7654,7 +7654,7 @@ loop_iv_add_mult_emit_before (loop, b, m, a, reg, before_bb, before_insn)
     }
 
   /* Use copy_rtx to prevent unexpected sharing of these rtx.  */
-  seq = gen_add_mult (copy_rtx (b), m, copy_rtx (a), reg);
+  seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg);
 
   /* Increase the lifetime of any invariants moved further in code.  */
   update_reg_last_use (a, before_insn);
@@ -7682,7 +7682,7 @@ loop_iv_add_mult_sink (loop, b, m, a, reg)
   rtx seq;
 
   /* Use copy_rtx to prevent unexpected sharing of these rtx.  */
-  seq = gen_add_mult (copy_rtx (b), m, copy_rtx (a), reg);
+  seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg);
 
   /* Increase the lifetime of any invariants moved further in code.
      ???? Is this really necessary?  */
@@ -7711,7 +7711,7 @@ loop_iv_add_mult_hoist (loop, b, m, a, reg)
   rtx seq;
 
   /* Use copy_rtx to prevent unexpected sharing of these rtx.  */
-  seq = gen_add_mult (copy_rtx (b), m, copy_rtx (a), reg);
+  seq = gen_add_mult (copy_rtx (b), copy_rtx (m), copy_rtx (a), reg);
 
   loop_insn_hoist (loop, seq);
 
-- 
GitLab