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]

Trying to work around a 16-bit x86 weirdness


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello world!

I'm trying to write a target port to generate 16-bit x86 code.  It's
going much better than I had hoped just a month ago.  But now I seem to
have hit a snag.  Something has changed, and I don't know whether I
wrote a bug or if GCC (HEAD) is assuming new things or what.

I have a really simple program I'm trying to compile:

void g(void)
{
        f(42, 17);
}

But when I compile it, I get this:

<big snip of verbose debugging I put in>

(const_int 2 [0x2])
Success.

======
GO_IF_LEGITIMATE_ADDRESS, mode = HI, strict = 1
(plus:HI (reg:HI bx [25])
    (const_int 2 [0x2]))
i86_decompose_address addr:
(plus:HI (reg:HI bx [25])
        (const_int 2 [0x2]))
i86_decompose_address base:
(reg:HI bx [25])
i86_decompose_address index:
(nil)
i86_decompose_address disp:
(const_int 2 [0x2])
Success.
../baby.c: In function `g':

../baby.c:4: error: unrecognizable insn:
(insn 23 8 24 0 (set (reg:HI bx [25])
        (const_int 42000 [0xa410])) -1 (nil)
    (nil))
../baby.c:4: internal compiler error: in extract_insn, at recog.c:2070
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:mailto:berndj@prism.co.za> for instructions.

Interestingly, I *have* a pattern that I thought that should match, in
my machine description:

(define_expand "movhi"
  [(set (match_operand:HI 0 "nonimmediate_operand" "")
        (match_operand:HI 1 "general_operand" ""))]
  ""
  "
{
  /* Don't generate memory->memory moves, go through a register */
  if ((reload_in_progress || reload_completed) == 0
      && GET_CODE (operands[0]) == MEM
      && GET_CODE (operands[1]) == MEM)
    {
      operands[1] = force_reg (HImode, operands[1]);
    }
}")

(define_insn "*movhi"
  [(set (match_operand:HI 0 "nonimmediate_operand" "=rm,r")
        (match_operand:HI 1 "general_operand" "ri,g"))]
  ""
  "movw\t%1,%0")

Does (const_int 42000) not match (match_operand:HI 1 ...)???  Why else
wouldn't that insn match?


What am I (likely to be) doing wrong?  (I realise it's hard to help
without seeing all my other code, but I'd have to get a formal OK and
preferably an assignment first.)

TIA & HAND, all

bernd
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE/k6B//FmLrNfLpjMRAgzyAKCAStAAvy5Vq73gg33rPRpMckKxUQCgpKx2
3eLKU2E60rK5+uWVXjnqAcE=
=Wi//
-----END PGP SIGNATURE-----


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