Hi,

(I finally resumed the work on my microcontroller I posted about 3
months ago...)

I have a problem with the jump instructions: my direct jumps are very
limited in displacements, and I want to always generate indirect jumps
instead.

So I wrote this:

        (define_insn "jump"
          [(set (pc)
                (label_ref (match_operand 0 "" "")))
           (clobber (match_scratch:QI 1 "=w"))]
          ""  
          "ldih %1,hi(%l0)\n\tldil %1,lo(%l0)\n\tijmp (%1)"
          [(set_attr "cc" "none")]
        )

gcc and libgcc get compiled ok, but several testsuite tests fail because
gcc is eating all the virtual memory when compiling the file. One of
those is for example gcc.c-torture/compile/20000120-2.c .

The problem is coming from the usage of 'match_scratch' here, because
removing it makes the problem go away.

Before going deeper and trying to see if I'm hitting a bug in gcc, can
someone please advice whether my define_insn is correct ? I'm using
gcc-4.3.1.

A stack trace from gdb seems to show that gcc is looping around here:

#0  0x080f70df in df_insn_rescan (insn=0x80951c08)
    at /wip/src/gcc-4.3.1/gcc/df-scan.c:1078
#1  0x0811b5ad in add_insn_after (insn=0x80951c08, after=0x80951be0, 
    bb=0xb7c17924)
    at /wip/src/gcc-4.3.1/gcc/emit-rtl.c:3495
#2  0x0811b870 in emit_jump_insn_after_noloc (x=0x80950c58,
after=0x80951be0)
    at /wip/src/gcc-4.3.1/gcc/emit-rtl.c:4085
#3  0x080da84c in try_redirect_by_replacing_jump (e=0xb7c26460, 
    target=0xb7c179d8, in_cfglayout=0 '\0')
    at /wip/src/gcc-4.3.1/gcc/cfgrtl.c:822
#4  0x08360a08 in cleanup_cfg (mode=1)
[...]

Thanks,

-- 
Stelian Pop <[EMAIL PROTECTED]>

Reply via email to