unconditional gen_rtx_MULT in expr.c

DJ Delorie dj@redhat.com
Wed Aug 24 04:55:00 GMT 2011


expr.c line 8139 has this:


      /* Attempt to return something suitable for generating an
	 indexed address, for machines that support that.  */

      if (modifier == EXPAND_SUM && mode == ptr_mode
	  && host_integerp (treeop1, 0))
	{
	  tree exp1 = treeop1;

	  op0 = expand_expr (treeop0, subtarget, VOIDmode,
			     EXPAND_SUM);

	  if (!REG_P (op0))
	    op0 = force_operand (op0, NULL_RTX);
	  if (!REG_P (op0))
	    op0 = copy_to_mode_reg (mode, op0);

	  return REDUCE_BIT_FIELD (gen_rtx_MULT (mode, op0,
			       gen_int_mode (tree_low_cst (exp1, 0),
					     TYPE_MODE (TREE_TYPE (exp1)))));
	}

Why isn't there a check to see if the machine actually supports that
MULT before blindly generating it?  The expand_mult() that follows is
able to handle that case if the machine doesn't have indexed addresses
or a real MUL insn.



More information about the Gcc mailing list