(match_operand 1 "nvptx_register_operand")]
""
{
- if (!TARGET_SOFT_STACK
- && TARGET_PTX_7_3
- && TARGET_SM52)
+ if (!TARGET_SOFT_STACK)
emit_insn (gen_nvptx_alloca (Pmode, operands[0], operands[1]));
- else if (!TARGET_SOFT_STACK)
- {
- sorry ("dynamic stack allocation not supported");
- emit_insn (gen_nop ());
- }
else if (TARGET_SOFT_STACK)
{
emit_move_insn (stack_pointer_rtx,
[(set (match_operand:P 0 "nvptx_register_operand" "=R")
(unspec:P [(match_operand:P 1 "nvptx_nonmemory_operand" "Ri")]
UNSPEC_ALLOCA))]
- "TARGET_PTX_7_3
- && TARGET_SM52"
+ ""
{
- /* Convert the address from '.local' state space to generic. That way,
- we don't have to use 'st.local', 'ld.local', and can easily pass the
- address to other "generic functions".
- TODO 'gcc.target/nvptx/alloca-5.c' */
- output_asm_insn ("{", NULL);
- output_asm_insn ("\\t.reg%t0\\t%0_local;", operands);
- output_asm_insn ("\\talloca%u0\\t%0_local, %1;", operands);
- output_asm_insn ("\\tcvta.local%u0\\t%0, %0_local;", operands);
- output_asm_insn ("}", NULL);
- return "";
+ if (TARGET_PTX_7_3
+ && TARGET_SM52)
+ {
+ /* Convert the address from '.local' state space to generic. That way,
+ we don't have to use 'st.local', 'ld.local', and can easily pass the
+ address to other "generic functions".
+ TODO 'gcc.target/nvptx/alloca-5.c' */
+ output_asm_insn ("{", NULL);
+ output_asm_insn ("\\t.reg%t0\\t%0_local;", operands);
+ output_asm_insn ("\\talloca%u0\\t%0_local, %1;", operands);
+ output_asm_insn ("\\tcvta.local%u0\\t%0, %0_local;", operands);
+ output_asm_insn ("}", NULL);
+ return "";
+ }
+ else
+ {
+ sorry_at (INSN_LOCATION (insn),
+ "dynamic stack allocation not supported");
+ return "";
+ }
}
[(set_attr "predicable" "no")])
-/* { dg-do compile } */
+/* { dg-do assemble } */
/* { dg-options {-O0 -mno-soft-stack} } */
/* { dg-additional-options -march=sm_30 } */
+/* { dg-additional-options -save-temps } */
+/* { dg-final { check-function-bodies {** } {} } } */
void f(void)
{
__builtin_alloca(123); /* { dg-warning "ignoring return value of '__builtin_alloca' declared with attribute 'warn_unused_result'" } */
- /* { dg-message {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
+ /* { dg-bogus {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
}
+/*
+** f:
+** \.visible \.func f
+** {
+** ret;
+*/