------- Additional Comments From dave at hiauly1 dot hia dot nrc dot ca  
2005-07-09 02:44 -------
Subject: Re:  [4.0/4.1 Regression] i-cobol.adb:482: error: unrecognizable insn

>  --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=9233&action=view)
> file that now ICEs with latest patch.
> 
> Compile the this file with -O2 -g on an arm-elf cross

This is totally untested but possibly something like the change below
would resolve the problem for both ports.

Dave
-- 
J. David Anglin                                  [EMAIL PROTECTED]
National Research Council of Canada              (613) 990-0752 (FAX: 952-6602)

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.535
diff -u -3 -p -r1.535 loop.c
--- loop.c      7 Jul 2005 22:53:28 -0000       1.535
+++ loop.c      9 Jul 2005 02:34:18 -0000
@@ -5496,14 +5496,21 @@ loop_givs_rescan (struct loop *loop, str
                                                  v->new_reg));
          else if (GET_CODE (*v->location) == PLUS
                   && REG_P (XEXP (*v->location, 0))
-                  && REG_P (v->new_reg)
                   && CONSTANT_P (XEXP (*v->location, 1)))
-           loop_insn_emit_before (loop, 0, v->insn,
-                                  gen_move_insn (XEXP (*v->location, 0),
-                                                 gen_rtx_MINUS
-                                                 (GET_MODE (*v->location),
-                                                  v->new_reg,
-                                                  XEXP (*v->location, 1))));
+           {
+             rtx reg, seq;
+             start_sequence ();
+             if (REG_P (v->new_reg))
+               reg = v->new_reg;
+             else
+               reg = force_reg (GET_MODE (*v->location), v->new_reg);
+             emit_move_insn (XEXP (*v->location, 0),
+                             gen_rtx_MINUS (GET_MODE (*v->location), reg,
+                                            XEXP (*v->location, 1)));
+             seq = get_insns ();
+             end_sequence ();
+             loop_insn_emit_before (loop, 0, v->insn, seq);
+           }
          else
            {
              /* If it wasn't a reg, create a pseudo and use that.  */


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22239

Reply via email to