From e951472536aab778c6bd5c605fc908439cd64cff Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Thu, 21 Jul 2011 15:46:28 +0000 Subject: [PATCH] avr.c (final_prescan_insn): Fix printing of rtx_costs. * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs. From-SVN: r176575 --- gcc/ChangeLog | 4 ++++ gcc/config/avr/avr.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index ccfcfeeb1fc..b9d95fa5b6e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2011-07-21 Georg-Johann Lay + + * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs. + 2011-07-21 Jason Merrill * system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New. diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index a1d0c885bd8..4951f56e092 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -1629,12 +1629,18 @@ byte_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) void final_prescan_insn (rtx insn, rtx *operand ATTRIBUTE_UNUSED, - int num_operands ATTRIBUTE_UNUSED) + int num_operands ATTRIBUTE_UNUSED) { if (TARGET_ALL_DEBUG) { - fprintf (asm_out_file, "/* DEBUG: cost = %d. */\n", - rtx_cost (PATTERN (insn), INSN, !optimize_size)); + rtx set = single_set (insn); + + if (set) + fprintf (asm_out_file, "/* DEBUG: cost = %d. */\n", + rtx_cost (SET_SRC (set), SET, optimize_insn_for_speed_p())); + else + fprintf (asm_out_file, "/* DEBUG: pattern-cost = %d. */\n", + rtx_cost (PATTERN (insn), INSN, optimize_insn_for_speed_p())); } }