Debian Codegraph @

gcc/testsuite/gcc.target/sh/pr54760-6.c

raw
1 /* Check that the GBR address optimization works when the GBR register
2 definition is not in the same basic block where the GBR memory accesses
3 are. */
4 /* { dg-do compile } */
5 /* { dg-options "-O1" } */
6 /* { dg-final { scan-assembler-not "stc\tgbr" } } */
7
8 typedef struct
9 {
10 int x, y, z, w;
11 } tcb_t;
12
13 int
14 test_00 (int a, tcb_t* b, int c)
15 {
16 tcb_t* tcb = (tcb_t*)__builtin_thread_pointer ();
17 return (a & 5) ? tcb->x : tcb->w;
18 }