OSDN Git Service

* reload1.c (delete_output_reload): Count occurrences in
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Dec 2006 00:25:29 +0000 (00:25 +0000)
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 6 Dec 2006 00:25:29 +0000 (00:25 +0000)
CALL_INSN_FUNCTION_USAGE.
* rtlanal.c (count_occurrences): Handle EXPR_LIST nodes without
crashing at the end of the list.

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

gcc/ChangeLog
gcc/reload1.c
gcc/rtlanal.c

index cba8137..3804f2d 100644 (file)
@@ -1,3 +1,10 @@
+2006-12-06  Bernd Schmidt  <bernd.schmidt@analog.com>
+
+       * reload1.c (delete_output_reload): Count occurrences in
+       CALL_INSN_FUNCTION_USAGE.
+       * rtlanal.c (count_occurrences): Handle EXPR_LIST nodes without
+       crashing at the end of the list.
+
 2006-12-05  Daniel Berlin  <dberlin@dberlin.org>
 
        * tree-ssa-structalias.c (set_used_smts): Re-fix pr29156.
index 88b89fe..fdab86c 100644 (file)
@@ -7972,6 +7972,9 @@ delete_output_reload (rtx insn, int j, int last_reload_reg)
        }
     }
   n_occurrences = count_occurrences (PATTERN (insn), reg, 0);
+  if (CALL_P (insn) && CALL_INSN_FUNCTION_USAGE (insn))
+    n_occurrences += count_occurrences (CALL_INSN_FUNCTION_USAGE (insn),
+                                       reg, 0);
   if (substed)
     n_occurrences += count_occurrences (PATTERN (insn),
                                        eliminate_regs (substed, 0,
index 6b96443..4b965f8 100644 (file)
@@ -509,6 +509,12 @@ count_occurrences (rtx x, rtx find, int count_dest)
     case CC0:
       return 0;
 
+    case EXPR_LIST:
+      count = count_occurrences (XEXP (x, 0), find, count_dest);
+      if (XEXP (x, 1))
+       count += count_occurrences (XEXP (x, 1), find, count_dest);
+      return count;
+       
     case MEM:
       if (MEM_P (find) && rtx_equal_p (x, find))
        return 1;