patch: sh interrupt attribute

Aldy Hernandez aldyh@redhat.com
Thu Jun 21 11:00:00 GMT 2001


Hi Joern.

As per our conversation...

The sh port is currently filling the delay slot in an interrupt_handler
function.  This may cause the wrong value to be popped out of the stack
if the insn in the delay slot updates the stack.  Like thus:

	foo
	rte
	mov.l   @r15+,r1

The rte will update PC and SR from the stack before the insn in the
delay slot finishes, thus getting the wrong value.

This is not a problem in >= TARGET_SH3.

The problem is that functions with the interrupt_handler attribute are
not considered to be interrupt handlers correctly by the SH backend:

void    f(void) __attribute__ ((interrupt_handler));

The sh port is currently looking at "#pragma interrupt" instead of the
interrupt_handler attribute.

The following patch fixes this and schedules insns in the delay slot if
>= TARGET_SH3.

Ok to install?

--
Aldy Hernandez			E-mail: aldyh@redhat.com
Professional Gypsy
Red Hat, Inc.


More information about the Gcc-patches mailing list