This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fix fortran/3393


On Mon, Feb 04, 2002 at 11:13:56AM +0800, Billinghurst, David (CRTS) wrote:
> ./f771 -quiet -mabi=64 -O2 pr3393.f
> pr3393.f: In program `pr3393':
> pr3393.f:11: unrecognizable insn:
> (insn 203 86 144 (set (reg:DI 114)
>         (plus:DI (reg:DI 114)
>             (sign_extend:DI (const_int 20 [0x14])))) -1 (nil)
>     (nil))

Tricky.  This is an rtl sharing problem.  The multiplier (M)
was (sign_extend:DI (reg:SI 87)), and that same rtx was plopped
into both insn 205 and 203.  CSE was able to simplify insn 205,
and in the process clobbered insn 203.

Fixed thus.


r~


        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.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.383
diff -c -p -d -u -r1.383 loop.c
--- loop.c	2002/01/31 01:37:22	1.383
+++ loop.c	2002/02/05 09:48:10
@@ -7654,7 +7654,7 @@ loop_iv_add_mult_emit_before (loop, b, m
     }
 
   /* 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, re
   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, r
   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);
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]