On 12-10-15 3:10 PM, Richard Sandiford wrote:
Vladimir Makarov <vmaka...@redhat.com> writes:
    After committing a patch yesterday to implement proposals from a
review, I found that GCC crashes on SPEC2000 gap.  LRA is trying to find
a mode of operand (const_int 1) in *lea_general_1 insn and can not find
it as the operand and insn template operand has VOIDmode.

There are still cases when context lookup is necessary to find a mode of
the operand.  So I am reversing the change I did yesterday.

The patch is committed as rev. 192462.

2012-10-15  Vladimir Makarov  <vmaka...@redhat.com>

          * lra-int.h (lra_get_mode): Remove.
          * lra-constraints.c (find_mode, get_op_mode): New functions.
          (match_reload): Use get_op_mode instead of lra_get_mode.
          (process_alt_operands, curr_insn_transform): Ditto.
But my objection to this code still stands.  It's wrong to assume
that an operand to an rtx has the same mode as the containing rtx.
I use it as only the last chance to find a mode for a constant.
Please add a testcase that shows the problem.


It is a SPEC2000 test file.  I don't think the license permits it.

In insn:

(define_insn_and_split "*lea_general_1"
  [(set (match_operand 0 "register_operand" "=r")
    (plus (plus (match_operand 1 "index_register_operand" "l")
            (match_operand 2 "register_operand" "r"))
          (match_operand 3 "immediate_operand" "i")))]

one operand is (const_int 1). Its mode is VOIDmode. recog_data mode is VOIDmode. The patch takes right mode from PLUS containing it.

Reply via email to