OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.target/] [sh/] [rte-delay-slot.c] - Blame information for rev 691

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 691 jeremybenn
/* { 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\\+" } } */
5
 
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.
10
 
11
   Incorrect code generated
12
        mov.l   @r15+,r1
13
        rte
14
        mov.l   @r15+,r14
15
 
16
   The right code should be
17
 
18
        mov.l   @r15+,r1
19
        mov.l   @r15+,r14
20
        rte
21
        nop
22
*/
23
void INT_MTU2_1_TGIA1 (void)
24
  __attribute__ ((interrupt_handler));
25
void
26
INT_MTU2_1_TGIA1 (void)
27
{
28
  volatile int i = 0;
29
  volatile int x, y;
30
 
31
  for (i = 0; i < 10; i++)
32
    y = y + x;
33
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.