diff --git a/gcc/testsuite/gcc.target/nvptx/stack_frame-1.c b/gcc/testsuite/gcc.target/nvptx/stack_frame-1.c new file mode 100644 index 0000000000000000000000000000000000000000..476d0ac93ed09db3835b378d81872dd38e82dab8 --- /dev/null +++ b/gcc/testsuite/gcc.target/nvptx/stack_frame-1.c @@ -0,0 +1,34 @@ +/* GCC emits an unused stack frame. */ + +/* { dg-do assemble } */ +/* { dg-options {-O2 -mno-soft-stack} } */ +/* { dg-additional-options -save-temps } */ +/* { dg-final { check-function-bodies {** } {} } } */ + +/* Greatly reduced from libgcc code, where this issue is visible for + '_divdi3.o:__divti3', '_divmoddi4.o:__divmodti4', '_moddi3.o:__modti3', + '_udivdi3.o:__udivti3', '_udivmoddi4.o:__udivmodti4', + '_umoddi3.o:__umodti3'. */ + +int f (int n) +{ + const union { + struct { long low, high; }; + __int128 ll; + } ww = {{.low = n, .high = 0}}; + return (int) ww.ll; +} +/* +** f: +** \.visible \.func \(\.param\.u32 %value_out\) f \(\.param\.u32 %in_ar0\) +** { +** \.reg\.u32 %value; +** \.reg\.u32 %ar0; +** ld\.param\.u32 %ar0, \[%in_ar0\]; +** \.local \.align 16 \.b8 %frame_ar\[16\]; +** \.reg\.u64 %frame; +** cvta\.local\.u64 %frame, %frame_ar; +** mov\.u32 %value, %ar0; +** st\.param\.u32 \[%value_out\], %value; +** ret; +*/