Debian Codegraph @

gcc/testsuite/gcc.target/nvptx/__builtin_alloca_0-1-O1.c

raw
1 /* Document what we run into for '__builtin_alloca(0)'. */
2
3 /* { dg-do compile }
4 TODO We can't 'assemble' this -- it's invalid PTX code. */
5 /* { dg-options {-O1 -mno-soft-stack} } */
6 /* { dg-additional-options -save-temps } */
7 /* { dg-final { check-function-bodies {** } {} } } */
8
9 /* See 'gcc.c-torture/execute/pr36321.c', '-O0'. */
10
11 void sink(void *);
12
13 void f(void)
14 {
15 sink(__builtin_alloca(0));
16 }
17 /*
18 ** f:
19 ** .visible .func f
20 ** {
21 ** {
22 ** \.param\.u64 %out_arg1;
23 ** st\.param\.u64 \[%out_arg1\], %stack;
24 ** call sink, \(%out_arg1\);
25 ** }
26 ** ret;
27 */
28
29 /* '%stack' is 'VIRTUAL_STACK_DYNAMIC_REGNUM', 'virtual_stack_dynamic_rtx'.
30 For '__builtin_alloca (0)', we get to
31 'gcc/explow.cc:allocate_dynamic_stack_space', where 'addr' gets set to
32 'virtual_stack_dynamic_rtx', 'size == const0_rtx', therefore 'return addr;',
33 which gets us '%stack' -- undefined (TODO).
34
35 { dg-final { scan-assembler-not {%stack} { xfail *-*-* } } } */