PR rtl-optimization/60663
* config/arm/arm.c (arm_new_rtx_costs): Improve ASM_OPERANDS case,
avoid 0 cost.
From-SVN: r209419
+2014-04-15 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ PR rtl-optimization/60663
+ * config/arm/arm.c (arm_new_rtx_costs): Improve ASM_OPERANDS case,
+ avoid 0 cost.
+
2014-04-15 Richard Biener <rguenther@suse.de>
* lto-streamer.h (LTO_major_version): Bump to 4.
return true;
case ASM_OPERANDS:
- /* Just a guess. Cost one insn per input. */
- *cost = COSTS_N_INSNS (ASM_OPERANDS_INPUT_LENGTH (x));
- return true;
+ {
+ /* Just a guess. Guess number of instructions in the asm
+ plus one insn per input. Always a minimum of COSTS_N_INSNS (1)
+ though (see PR60663). */
+ int asm_length = MAX (1, asm_str_count (ASM_OPERANDS_TEMPLATE (x)));
+ int num_operands = ASM_OPERANDS_INPUT_LENGTH (x);
+ *cost = COSTS_N_INSNS (asm_length + num_operands);
+ return true;
+ }
default:
if (mode != VOIDmode)
*cost = COSTS_N_INSNS (ARM_NUM_REGS (mode));