[PATCH, committed] SH: Fix PR58314 (unsatisfied constraints)

Kaz Kojima kkojima@rr.iij4u.or.jp
Wed Sep 18 23:51:00 GMT 2013


Christian Bruel <christian.bruel@st.com> wrote:
> && (!can_create_pseudo_p () && REG_P (operands[0]) && REG_P (operands[1]))"
> 
> is necessary ?

It looks an another hack to allow the 2nd and 3rd alternatives only
when reloading.  If so, it might be a bit cleaner to use a special
predicate like

;; Returns 1 if OP can be a source of a mov*_reg_reg insn. Same as
;; general_movsrc_operand, but mem allowed only when reload in progress.
(define_predicate "movsrc_reg_reg_operand"
  (match_code "subreg,reg,mem")
{
  if (reload_in_progress && MEM_P (op))
    return general_movsrc_operand (op, mode);

  return register_operand (op, mode);
})

and its dst version for that purpose.

>> BTW, in the test case (gcc.target/sh/torture/pr58314.c), this 
>>
>> /* { dg-options "-Os" } */
>>
>> defeats the purpose of the torture tests.
> 
> does it ? I though that the dg-option would be a force it in addition to
> the torture-option list (which should include -Os anyway, but it's just
> to make sure). In my log I have
> 
> PASS: gcc.target/sh/torture/pr58314.c  -O0  (test for excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -O1  (test for excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -O2  (test for excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -O3 -funroll-loops  (test for
> excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -O3 -funroll-all-loops
> -finline-functions  (test for excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -O3 -g  (test for excess errors)
> PASS: gcc.target/sh/torture/pr58314.c  -Os  (test for excess errors)

/* { dg-options "" } */

will work.

Regards,
	kaz



More information about the Gcc-patches mailing list