From: Bernd Schmidt Date: Wed, 6 Dec 2006 00:25:29 +0000 (+0000) Subject: reload1.c (delete_output_reload): Count occurrences in CALL_INSN_FUNCTION_USAGE. X-Git-Tag: releases/gcc-4.3.0~8106 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2372a0625790417f2ca021d3e5016554930900a4;p=thirdparty%2Fgcc.git reload1.c (delete_output_reload): Count occurrences in CALL_INSN_FUNCTION_USAGE. * 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. From-SVN: r119571 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index cba81372cc76..3804f2db97f8 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2006-12-06 Bernd Schmidt + + * 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 * tree-ssa-structalias.c (set_used_smts): Re-fix pr29156. diff --git a/gcc/reload1.c b/gcc/reload1.c index 88b89feb8ff1..fdab86cff87d 100644 --- a/gcc/reload1.c +++ b/gcc/reload1.c @@ -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, diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 6b964430ef02..4b965f8ca1c2 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -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;