This is the mail archive of the 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: fold_const.c/tree_swap_operands_p change from Oct 11 breaks m68k

On Sat, 25 Oct 2003, Gunther Nikl wrote:
> Whether your code is correct or the m68k backend has a bug which is
> now uncovered I don't know. I used a cross-compiler to m68k-linux for
> my tests.

Hi Gunther,

I must admit that the cause of the failure is a mystery to me.
In the .35.ce3 dump, the last RTL dump before we emit the assembly
langauge file, the instruction is still there:

(insn 49 38 39 0 (set (reg/s:SI %a0 [32])
        (reg:SI %d0 [33])) 25 {*} (insn_list 38 (nil))

(insn 39 49 40 0 (set (cc0)
        (reg:SI %d0 [33])) 3 {*} (nil)
    (expr_list:REG_DEAD (reg:SI %d0 [33])

(jump_insn 40 39 11 0 (set (pc)
        (if_then_else (leu (cc0)
                (const_int 0 [0x0]))
            (label_ref 41)
            (pc))) 318 {bleu} (nil)
    (expr_list:REG_BR_PROB (const_int 3600 [0xe10])

But it never appears in the .s file:

        move.l %d0,%a0   <- insn 49
        jbls .L7         <- jump_insn 40

I'm not really a back-end expert.  Here is the relevant define_insn
from line 196 of  Can anyone see an obvious mistake?

(define_insn ""
  [(set (cc0)
        (match_operand:SI 0 "nonimmediate_operand" "rm"))]
  if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (operands[0]))
    return \"tst%.l %0\";
  /* If you think that the 68020 does not support tstl a0,
     reread page B-167 of the 68020 manual more carefully.  */
  /* On an address reg, cmpw may replace cmpl.  */
  return \"cmp%.w %0,%#0\";
  return \"cmp%.w %#0,%0\";

This seems to return a suitable string from all paths through the
relevant code.  Unless someone can point out the obvious mistake,
I'll have to step through the relevant bits of gcc within gdb.

Many thanks in advance,


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