OSDN Git Service

PR rtl-optimization/15521:
authoramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2004 12:48:21 +0000 (12:48 +0000)
committeramylaar <amylaar@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 9 Jun 2004 12:48:21 +0000 (12:48 +0000)
* sched-int.h (in_post_call_group_p): Change type to enum.
* sched-deps.c (sched_analyze_insn):
(sched_analyze): When in_post_call_group_p is post_call_initial,
don't add a dependency, but still set SCHED_GROUP_P and CANT_MOVE,
and also reset in_post_call_group_p to post_call.
(sched_analyze): When the previous basic block ended in a CALL_INSN,
initialize in_post_call_group_p as post_call_initial.
(init_deps): initialize in_post_call_group_p to not_post_call.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@82831 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/sched-deps.c
gcc/sched-int.h

index db8a7c3..55d2914 100644 (file)
@@ -1,3 +1,15 @@
+2004-06-09  J"orn Rennecke <joern.rennecke@superh.com>
+
+       PR rtl-optimization/15521:
+       * sched-int.h (in_post_call_group_p): Change type to enum.
+       * sched-deps.c (sched_analyze_insn):
+       (sched_analyze): When in_post_call_group_p is post_call_initial,
+       don't add a dependency, but still set SCHED_GROUP_P and CANT_MOVE,
+       and also reset in_post_call_group_p to post_call.
+       (sched_analyze): When the previous basic block ended in a CALL_INSN,
+       initialize in_post_call_group_p as post_call_initial.
+       (init_deps): initialize in_post_call_group_p to not_post_call.
+       
 2004-06-09  Arnaud Charlet  <charlet@act-europe.fr>
 
        PR ada/6637
 2004-06-09  Arnaud Charlet  <charlet@act-europe.fr>
 
        PR ada/6637
index 7802bf2..c1c4ece 100644 (file)
@@ -1145,13 +1145,21 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
       if (src_regno < FIRST_PSEUDO_REGISTER
          || dest_regno < FIRST_PSEUDO_REGISTER)
        {
       if (src_regno < FIRST_PSEUDO_REGISTER
          || dest_regno < FIRST_PSEUDO_REGISTER)
        {
-         set_sched_group_p (insn);
+         /* If we are inside a post-call group right at the start of the
+            scheduling region, we must not add a dependency.  */
+         if (deps->in_post_call_group_p == post_call_initial)
+           {
+             SCHED_GROUP_P (insn) = 1;
+             deps->in_post_call_group_p = post_call;
+           }
+         else
+           set_sched_group_p (insn);
          CANT_MOVE (insn) = 1;
        }
       else
        {
        end_call_group:
          CANT_MOVE (insn) = 1;
        }
       else
        {
        end_call_group:
-         deps->in_post_call_group_p = false;
+         deps->in_post_call_group_p = not_post_call;
        }
     }
 }
        }
     }
 }
@@ -1168,6 +1176,15 @@ sched_analyze (struct deps *deps, rtx head, rtx tail)
   if (current_sched_info->use_cselib)
     cselib_init (true);
 
   if (current_sched_info->use_cselib)
     cselib_init (true);
 
+  /* Before reload, if the previous block ended in a call, show that
+     we are inside a post-call group, so as to keep the lifetimes of
+     hard registers correct.  */
+  if (! reload_completed && GET_CODE (head) != CODE_LABEL)
+    {
+      insn = prev_nonnote_insn (head);
+      if (insn && GET_CODE (insn) == CALL_INSN)
+       deps->in_post_call_group_p = post_call_initial;
+    }
   for (insn = head;; insn = NEXT_INSN (insn))
     {
       rtx link, end_seq, r0, set;
   for (insn = head;; insn = NEXT_INSN (insn))
     {
       rtx link, end_seq, r0, set;
@@ -1259,7 +1276,7 @@ sched_analyze (struct deps *deps, rtx head, rtx tail)
          /* Before reload, begin a post-call group, so as to keep the
             lifetimes of hard registers correct.  */
          if (! reload_completed)
          /* Before reload, begin a post-call group, so as to keep the
             lifetimes of hard registers correct.  */
          if (! reload_completed)
-           deps->in_post_call_group_p = true;
+           deps->in_post_call_group_p = post_call;
        }
 
       /* See comments on reemit_notes as to why we do this.
        }
 
       /* See comments on reemit_notes as to why we do this.
@@ -1420,7 +1437,7 @@ init_deps (struct deps *deps)
   deps->last_pending_memory_flush = 0;
   deps->last_function_call = 0;
   deps->sched_before_next_call = 0;
   deps->last_pending_memory_flush = 0;
   deps->last_function_call = 0;
   deps->sched_before_next_call = 0;
-  deps->in_post_call_group_p = false;
+  deps->in_post_call_group_p = not_post_call;
   deps->libcall_block_tail_insn = 0;
 }
 
   deps->libcall_block_tail_insn = 0;
 }
 
index 6387227..383a29d 100644 (file)
@@ -94,7 +94,7 @@ struct deps
 
   /* Used to keep post-call pseudo/hard reg movements together with
      the call.  */
 
   /* Used to keep post-call pseudo/hard reg movements together with
      the call.  */
-  bool in_post_call_group_p;
+  enum { not_post_call, post_call, post_call_initial } in_post_call_group_p;
 
   /* Set to the tail insn of the outermost libcall block.
 
 
   /* Set to the tail insn of the outermost libcall block.