re PR rtl-optimization/14282 (ICE in sh-elf-gcc with -m4-single-only and -O2)
authorDJ Delorie <dj@redhat.com>
Thu, 4 Mar 2004 19:03:02 +0000 (14:03 -0500)
committerDJ Delorie <dj@gcc.gnu.org>
Thu, 4 Mar 2004 19:03:02 +0000 (14:03 -0500)
PR optimization/14282
* sched-deps.c (sched_analyze_insn): Allow a stack adjustment
between a call and the assignment of its return value.

From-SVN: r78925

gcc/ChangeLog
gcc/sched-deps.c

index 03a47a3..4f53e6b 100644 (file)
@@ -1,3 +1,9 @@
+2004-03-04  DJ Delorie  <dj@redhat.com>
+
+       PR optimization/14282
+       * sched-deps.c (sched_analyze_insn): Allow a stack adjustment
+       between a call and the assignment of its return value.
+
 2004-03-04  Kazu Hirata  <kazu@cs.umass.edu>
 
        * config/h8300/h8300.c: Put a comment for every function.
index 754142f..ad96281 100644 (file)
@@ -1127,7 +1127,13 @@ sched_analyze_insn (struct deps *deps, rtx x, rtx insn, rtx loop_notes)
       tmp = SET_SRC (set);
       if (GET_CODE (tmp) == SUBREG)
        tmp = SUBREG_REG (tmp);
-      if (GET_CODE (tmp) == REG)
+      if ((GET_CODE (tmp) == PLUS
+          || GET_CODE (tmp) == MINUS)
+         && GET_CODE (XEXP (tmp, 0)) == REG
+         && REGNO (XEXP (tmp, 0)) == STACK_POINTER_REGNUM
+         && dest_regno == STACK_POINTER_REGNUM)
+       src_regno = STACK_POINTER_REGNUM;
+      else if (GET_CODE (tmp) == REG)
        src_regno = REGNO (tmp);
       else
        goto end_call_group;