Hi,

m68k currently doesn't bootstrap, which I think is dataflow related, the 
whole precompiled file is at http://www.xs4all.nl/~zippel/expmed.i.gz, but 
the small test below should be enough to demonstrate the problem 
(although it doesn't crash):

int fi1(int);
int fi2(int);
void *fp1(int, void *);
void *fp2(int, int);

void *f(int x, int a, int b)
{
        if (x) {
                int y = fi1(1);
                void *p;
                y += fi2(3);
                p = fp1(2, 0);
                return fp1(y, p);
        } else {
                int z = fi2(2);
                z += fi1(z);
                return fp2(z, 3);
        }
}

The function is exited here via a sibcall, one important thing is that 
current_function_return_rtx is set to:

(parallel/i:SI [
        (expr_list:REG_DEP_TRUE (reg:SI 8 %a0 [ <result> ])
            (const_int 0 [0x0]))
        (expr_list:REG_DEP_TRUE (reg:SI 0 %d0 [ <result> ])
            (const_int 0 [0x0]))
    ])

This means the return value is returned in both %d0/%a0.

The problem is now that this seems to produce incorrect REG_DEAD notes for 
%d0, they are missing at the last use before the sibcall. This now seems 
to confuse reload in the full test case, where it calls 
save_call_clobbered_regs(), which can't quite decide whether to save %d0 
across a function call or not.
setup_save_areas() doesn't create a stack slot for %d0 because it's not 
associated with a pseudo which lives across a function call, but later in 
save_call_clobbered_regs() %d0 is still live at a function call and it
attempts to save the register, which fails due to the missing stack slot.

AFAICT this behaviour is correct, the question is now how do I get 
correct REG_DEAD notes? It seems to be related to the unusual return 
expression above, but at this point I need some help to fix this.

bye, Roman

Reply via email to