]> gcc.gnu.org Git - gcc.git/commitdiff
regmove.c: Fix various minor formatting problems.
authorJim Wilson <wilson@cygnus.com>
Sun, 8 Feb 1998 11:43:54 +0000 (11:43 +0000)
committerJeff Law <law@gcc.gnu.org>
Sun, 8 Feb 1998 11:43:54 +0000 (04:43 -0700)
        * regmove.c: Fix various minor formatting problems.
        (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions
        is true.  Make end of basic block tests consistent through regmove.c.
        (optimize_reg_copy_2, optimize_reg_copy_3): Likewise.
        (fixup_match_2, fixup_match_1, regmove_optimize): Likewise.

Co-Authored-By: Jeffrey A Law <law@cygnus.com>
From-SVN: r17775

gcc/ChangeLog
gcc/regmove.c

index fdb29ec34c133063640cbb3851105b9d3bcb9bde..58e0b1b6505fe3106b098833eb3525864db7334f 100644 (file)
@@ -1,3 +1,12 @@
+Sun Feb  8 12:04:24 1998  Jim Wilson  (wilson@cygnus.com)
+                         Jeff Law (law@cygnus.com)
+
+       * regmove.c: Fix various minor formatting problems.
+       (optimize_reg_copy_1): Stop search at CALL_INSNs if flag_exceptions
+       is true.  Make end of basic block tests consistent through regmove.c.
+       (optimize_reg_copy_2, optimize_reg_copy_3): Likewise.
+       (fixup_match_2, fixup_match_1, regmove_optimize): Likewise.
+
 Sun Feb  8 01:49:18 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>
 
        * gansidecl.h: Check for a conflicting macro definition before
index 55c380a9c31fa99d1222677d4f0de6db8b3437a7..4d1062df88f0730a9b46ec1b1b69468d19765756 100644 (file)
@@ -206,6 +206,14 @@ optimize_reg_copy_1 (insn, dest, src)
                  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
        break;
 
+      /* ??? We can't scan past the end of a basic block without updating
+        the register lifetime info (REG_DEAD/basic_block_live_at_start).
+        A CALL_INSN might be the last insn of a basic block, if it is inside
+        an EH region.  There is no easy way to tell, so we just always break
+        when we see a CALL_INSN if flag_exceptions is nonzero.  */
+      if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+       break;
+
       if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
        continue;
 
@@ -380,6 +388,14 @@ optimize_reg_copy_2 (insn, dest, src)
                  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
        break;
 
+      /* ??? We can't scan past the end of a basic block without updating
+        the register lifetime info (REG_DEAD/basic_block_live_at_start).
+        A CALL_INSN might be the last insn of a basic block, if it is inside
+        an EH region.  There is no easy way to tell, so we just always break
+        when we see a CALL_INSN if flag_exceptions is nonzero.  */
+      if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+       break;
+
       if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
        continue;
 
@@ -451,10 +467,22 @@ optimize_reg_copy_3 (insn, dest, src)
     return;
   for (p = PREV_INSN (insn); ! reg_set_p (src_reg, p); p = PREV_INSN (p))
     {
+      if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
+         || (GET_CODE (p) == NOTE
+             && (NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_BEG
+                 || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
+       return;
+
+      /* ??? We can't scan past the end of a basic block without updating
+        the register lifetime info (REG_DEAD/basic_block_live_at_start).
+        A CALL_INSN might be the last insn of a basic block, if it is inside
+        an EH region.  There is no easy way to tell, so we just always break
+        when we see a CALL_INSN if flag_exceptions is nonzero.  */
+      if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+       return;
+
       if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
        continue;
-      if (GET_CODE (p) == JUMP_INSN)
-       return;
     }
   if (! (set = single_set (p))
       || GET_CODE (SET_SRC (set)) != MEM
@@ -541,7 +569,8 @@ reg_is_remote_constant_p (reg, insn, first)
 
 /* cse disrupts preincrement / postdecrement squences when it finds a
    hard register as ultimate source, like the frame pointer.  */
-int fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
+int
+fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
      rtx insn, dst, src, offset;
      FILE *regmove_dump_file;
 {
@@ -567,13 +596,21 @@ int fixup_match_2 (insn, dst, src, offset, regmove_dump_file)
                   || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
         break;
 
+      /* ??? We can't scan past the end of a basic block without updating
+        the register lifetime info (REG_DEAD/basic_block_live_at_start).
+        A CALL_INSN might be the last insn of a basic block, if it is inside
+        an EH region.  There is no easy way to tell, so we just always break
+        when we see a CALL_INSN if flag_exceptions is nonzero.  */
+      if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+       break;
+
       if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
         continue;
 
-  if (find_regno_note (p, REG_DEAD, REGNO (dst)))
-    dst_death = p;
-  if (! dst_death)
-    length++;
+      if (find_regno_note (p, REG_DEAD, REGNO (dst)))
+       dst_death = p;
+      if (! dst_death)
+       length++;
 
       pset = single_set (p);
       if (pset && SET_DEST (pset) == dst
@@ -978,6 +1015,16 @@ regmove_optimize (f, nregs, regmove_dump_file)
                              || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
                    break;
 
+                 /* ??? We can't scan past the end of a basic block without
+                    updating the register lifetime info
+                    (REG_DEAD/basic_block_live_at_start).
+                    A CALL_INSN might be the last insn of a basic block, if
+                    it is inside an EH region.  There is no easy way to tell,
+                    so we just always break when we see a CALL_INSN if
+                    flag_exceptions is nonzero.  */
+                 if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+                   break;
+
                  if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
                    continue;
 
@@ -1245,6 +1292,14 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
                  || NOTE_LINE_NUMBER (p) == NOTE_INSN_LOOP_END)))
        break;
 
+      /* ??? We can't scan past the end of a basic block without updating
+        the register lifetime info (REG_DEAD/basic_block_live_at_start).
+        A CALL_INSN might be the last insn of a basic block, if it is
+        inside an EH region.  There is no easy way to tell, so we just
+        always break when we see a CALL_INSN if flag_exceptions is nonzero.  */
+      if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+       break;
+
       if (GET_RTX_CLASS (GET_CODE (p)) != 'i')
        continue;
 
@@ -1281,6 +1336,20 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
                      q = 0;
                      break;
                    }
+
+                 /* ??? We can't scan past the end of a basic block without
+                    updating the register lifetime info
+                    (REG_DEAD/basic_block_live_at_start).
+                    A CALL_INSN might be the last insn of a basic block, if
+                    it is inside an EH region.  There is no easy way to tell,
+                    so we just always break when we see a CALL_INSN if
+                    flag_exceptions is nonzero.  */
+                 if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+                   {
+                     q = 0;
+                     break;
+                   }
+
                  if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
                    continue;
                  if (reg_overlap_mentioned_p (src, PATTERN (q))
@@ -1434,11 +1503,28 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
        {
          for (q = PREV_INSN (insn); q; q = PREV_INSN(q))
            {
-             if (GET_CODE (q) == JUMP_INSN)
+             if (GET_CODE (q) == CODE_LABEL || GET_CODE (q) == JUMP_INSN
+                 || (GET_CODE (q) == NOTE
+                     && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
+                         || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
                {
                  q = 0;
                  break;
                }
+
+             /* ??? We can't scan past the end of a basic block without
+                updating the register lifetime info
+                (REG_DEAD/basic_block_live_at_start).
+                A CALL_INSN might be the last insn of a basic block, if
+                it is inside an EH region.  There is no easy way to tell,
+                so we just always break when we see a CALL_INSN if
+                flag_exceptions is nonzero.  */
+             if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+               {
+                 q = 0;
+                 break;
+               }
+
              if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
                continue;
              s_length2++;
@@ -1510,6 +1596,16 @@ fixup_match_1 (insn, set, src, src_subreg, dst, backward, operand_number,
                  && (NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_BEG
                      || NOTE_LINE_NUMBER (q) == NOTE_INSN_LOOP_END)))
            break;
+
+         /* ??? We can't scan past the end of a basic block without updating
+            the register lifetime info (REG_DEAD/basic_block_live_at_start).
+            A CALL_INSN might be the last insn of a basic block, if it
+            is inside an EH region.  There is no easy way to tell so we
+            just always break when we see a CALL_INSN if flag_exceptions
+            is nonzero.  */
+         if (flag_exceptions && GET_CODE (p) == CALL_INSN)
+           break;
+
          if (GET_RTX_CLASS (GET_CODE (q)) != 'i')
            continue;
          if (src != inc_dest && (reg_overlap_mentioned_p (src, PATTERN (q))
This page took 0.083097 seconds and 5 git commands to generate.