avr.c (final_prescan_insn): Fix printing of rtx_costs.
authorGeorg-Johann Lay <avr@gjlay.de>
Thu, 21 Jul 2011 15:46:28 +0000 (15:46 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Thu, 21 Jul 2011 15:46:28 +0000 (15:46 +0000)
* config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.

From-SVN: r176575

gcc/ChangeLog
gcc/config/avr/avr.c

index ccfcfeeb1fce36c327d6a065d9c1833798b8d980..b9d95fa5b6e9cbbd76fb5efdfd6216bba32e3495 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-21  Georg-Johann Lay  <avr@gjlay.de>
+       
+       * config/avr/avr.c (final_prescan_insn): Fix printing of rtx_costs.
+
 2011-07-21  Jason Merrill  <jason@redhat.com>
 
        * system.h (HAVE_DESIGNATED_UNION_INITIALIZERS): New.
index a1d0c885bd86f0e962f7c8faed44d6328796296f..4951f56e092d3194d2c00d3699fa9da5b33235e5 100644 (file)
@@ -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()));
     }
 }