This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: volatile correctness: combine vs. target.md


Georg-Johann Lay <avr@gjlay.de> writes:

> Is insn combine allowed to match the insn because from combine's
> perspective just a CONST_INT (i.e. low_io_address_operand) is moved
> across the access of UDR0?

Yes.

> Or is this a bug in insn combine?

No.

> If combine is right -- and thus the pattern is wrong -- how must the
> insn be rewritten to produce respective instructions?

The backend must define and use a new recog predicate which recognizes

(mem:QI x)

where x satisfies low_io_address_operand.  The predicate should also
check that its operand satisfies general_operand.  E.g., something along
the lines of

(define_predicate "low_io_mem"
  (and (match_operand 0 "general_operand")
       (and (match_code "mem")
            (match_test "low_io_address_operand (XEXP (op, 0))"))))

Ian


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]