2 /* { dg-require-effective-target htm } */
3 /* { dg-options "-O3 -march=zEC12 -mzarch --save-temps" } */
5 /* __builtin_tbegin has to emit clobbers for all FPRs since the tbegin
6 instruction does not automatically preserves them. If the
7 transaction body is fully contained in a function the backend tries
8 after reload to get rid of the FPR save/restore operations
9 triggered by the clobbers. This testcase failed since the backend
10 was able to get rid of all FPR saves/restores and since these were
11 the only stack operations also of the entire stack space. So even
12 the save/restore of the stack pointer was omitted in the end.
13 However, since the frame layout has been fixed before, the prologue
14 still generated the stack pointer decrement making foo return with
15 a modified stack pointer. */
19 void __attribute__((noinline
))
22 if (__builtin_tbegin (0) == 0)
27 #define GET_STACK_POINTER(SP) \
28 asm volatile ("stg %%r15, %0" : "=QRST" (SP));
30 #define GET_STACK_POINTER(SP) \
31 asm volatile ("st %%r15, %0" : "=QR" (SP));
36 unsigned long new_sp
, old_sp
;
38 GET_STACK_POINTER (old_sp
);
40 GET_STACK_POINTER (new_sp
);
48 /* Make sure no FPR saves/restores are emitted. */
49 /* { dg-final { scan-assembler-not "\tstd\t" } } */
50 /* { dg-final { scan-assembler-not "\tld\t" } } */