PR 7409/Loop optimization bug patch

Hartmut Penner HPENNER@de.ibm.com
Thu Jul 25 11:18:00 GMT 2002


A proposed patch for problem described in PR7409 is appended here.
The problem was, that the usage of a register as a parameter was not taken
into acount in the function find_single_use_in_loop.

Index: loop.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/loop.c,v
retrieving revision 1.389.2.7
diff -u -r1.389.2.7 loop.c
--- loop.c      15 Jun 2002 01:12:04 -0000      1.389.2.7
+++ loop.c      25 Jul 2002 17:41:28 -0000
@@ -3448,6 +3448,19 @@
   const char *fmt = GET_RTX_FORMAT (code);
   int i, j;

+  if (x == PATTERN (insn) && GET_CODE (insn) == CALL_INSN)
+    {
+      rtx link;
+      for (link = CALL_INSN_FUNCTION_USAGE (insn); link; link = XEXP (link, 1))
+       {
+         rtx op, reg;
+
+         if (GET_CODE (op = XEXP (link, 0)) == USE
+             && GET_CODE (reg = XEXP (op, 0)) == REG)
+           regs->array[REGNO (reg)].single_usage = const0_rtx;
+       }
+    }
+
   if (code == REG)
     regs->array[REGNO (x)].single_usage
       = (regs->array[REGNO (x)].single_usage != 0



Mit freundlichem Gruß / Best regards,

Hartmut Penner
GCC for S/390 Development




More information about the Gcc-patches mailing list