* config/sh/sh.md (*movqi_pop): New insn pattern.
[official-gcc.git] / gcc / testsuite / gcc.target / sh / rte-delay-slot.c
blobeca5db94355b5a852681eb4c130215a588619a75
1 /* { dg-do compile { target "sh-*-*" } } */
2 /* { dg-options "-O2" } */
3 /* { dg-skip-if "" { "sh*-*-*" } "*" "-m1 -m2*" } */
4 /* { dg-final { scan-assembler-not "\trte\t\n\tmov.l\t@r15\\+" } } */
6 /* This test checks if the compiler generates a pop instruction
7 in the delay slot after rte. For the sh and sh2, the rte
8 instruction reads the return pc from the stack and any pop
9 in the delay slot crashes the hardware.
11 Incorrect code generated
12 mov.l @r15+,r1
13 rte
14 mov.l @r15+,r14
16 The right code should be
18 mov.l @r15+,r1
19 mov.l @r15+,r14
20 rte
21 nop
23 void INT_MTU2_1_TGIA1 (void)
24 __attribute__ ((interrupt_handler));
25 void
26 INT_MTU2_1_TGIA1 (void)
28 volatile int i = 0;
29 volatile int x, y;
31 for (i = 0; i < 10; i++)
32 y = y + x;