reload vs adds with clobbers

DJ Delorie dj@redhat.com
Fri May 30 20:27:00 GMT 2003


In gen_reload (reload1.c) there's a chunk of code that creates an add
insn without going through the usual expanders:

line 7471:
      if (op0 != XEXP (in, 0) || op1 != XEXP (in, 1))
	in = gen_rtx_PLUS (GET_MODE (in), op0, op1);

      insn = emit_insn (gen_rtx_SET (VOIDmode, out, in));
      code = recog_memoized (insn);

Unfortunately, for xstormy16, the add instruction has a clobber (it
clobbers the carry), so it doesn't match.  The fallthrough code (for
above) tries to expand the add into two insns, but that totally blows
up in this case (adding a constant to a register) due to its
assumptions about what would fail the above recog.

What's the right way to address this problem?



More information about the Gcc mailing list