]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
BPF, nvptx: Standardize on 'sorry, unimplemented: dynamic stack allocation not supported'
authorThomas Schwinge <tschwinge@baylibre.com>
Fri, 21 Feb 2025 10:21:08 +0000 (11:21 +0100)
committerThomas Schwinge <tschwinge@baylibre.com>
Sat, 22 Feb 2025 21:37:50 +0000 (22:37 +0100)
... instead of BPF: 'error: BPF does not support dynamic stack allocation', and
nvptx: 'sorry, unimplemented: target cannot support alloca'.

gcc/
* config/bpf/bpf.md (define_expand "allocate_stack"): Emit
'sorry, unimplemented: dynamic stack allocation not supported'.
* config/nvptx/nvptx.md (define_expand "allocate_stack")
[!TARGET_SOFT_STACK && !(TARGET_PTX_7_3 && TARGET_SM52)]: Likewise.
gcc/testsuite/
* gcc.target/bpf/diag-alloca-1.c: Adjust 'dg-message'.
* gcc.target/bpf/diag-alloca-2.c: Likewise.
* gcc.target/nvptx/alloca-1-sm_30.c: Likewise.
* gcc.target/nvptx/vla-1-sm_30.c: Likewise.
* lib/target-supports.exp (proc check_effective_target_alloca):
Adjust comment.

gcc/config/bpf/bpf.md
gcc/config/nvptx/nvptx.md
gcc/testsuite/gcc.target/bpf/diag-alloca-1.c
gcc/testsuite/gcc.target/bpf/diag-alloca-2.c
gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c
gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c
gcc/testsuite/lib/target-supports.exp

index 12cf9fae855cece180aeb91854476f68e44243fe..91d94838e39598001b9c2fbe3986ad1e08f32c75 100644 (file)
   [(match_operand:DI 0 "general_operand" "")
    (match_operand:DI 1 "general_operand" "")]
   ""
-  "
 {
-  error (\"BPF does not support dynamic stack allocation\");
+  sorry ("dynamic stack allocation not supported");
   emit_insn (gen_nop ());
   DONE;
-}")
+})
 
 ;;;; Arithmetic/Logical
 
index d3d538070c0fef3b8128dc238c0980c6a439739f..e7d3630d4c4b6cc1fd28f6694d54e6077c77d013 100644 (file)
     emit_insn (gen_nvptx_alloca (Pmode, operands[0], operands[1]));
   else if (!TARGET_SOFT_STACK)
     {
-      sorry ("target cannot support alloca");
+      sorry ("dynamic stack allocation not supported");
       emit_insn (gen_nop ());
     }
   else if (TARGET_SOFT_STACK)
index 0406f2c35958e7c76308ba17862bbcbfb004ba30..e549cab84cafbb4b175e525bec23f457f6d8cd2f 100644 (file)
@@ -3,7 +3,8 @@
 int
 foo (int x)
 {
-  int *p = __builtin_alloca (x); /* { dg-error "support" } */
+  int *p = __builtin_alloca (x);
+  /* { dg-message {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
 
   return p[2];
 }
index ef7170b2c3d3f647dc9c8c297267519af72f9162..b1084bf57268cf4623bc8787a9627431f592acbc 100644 (file)
@@ -4,6 +4,8 @@
 int
 foo (int x)
 {
-  int arr[x]; /* { dg-error "support" } */
+  int arr[x];
+  /* { dg-message {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
+
   return arr[3];
 }
index 261a603ec4ce89fe46aa8e247733cc66f20d5b52..5538751035bce794ef4a02f3f35114aeb79e3e9e 100644 (file)
@@ -7,5 +7,5 @@ void sink(void *);
 void f(void)
 {
   sink(__builtin_alloca(123));
-  /* { dg-message {sorry, unimplemented: target cannot support alloca} {} { target *-*-* } .-1 } */
+  /* { dg-message {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
 }
index 2bf2c91d60e9fe00f41dd6c7f3832cf4c9f3417e..7c2d2e0e35ba4eae26ff4a190009e442b6bb6465 100644 (file)
@@ -7,6 +7,6 @@ void sink(void *);
 void f(int s)
 {
   char a[s];
-  /* { dg-message {sorry, unimplemented: target cannot support alloca} {} { target *-*-* } .-1 } */
+  /* { dg-message {sorry, unimplemented: dynamic stack allocation not supported} {} { target *-*-* } .-1 } */
   sink(a);
 }
index 9b5fbe527561329026091b3d02419eec38e43470..7eab76a7eb66b81d00a1d0f557354cff26641bab 100644 (file)
@@ -1002,7 +1002,7 @@ proc check_effective_target_untyped_assembly {} {
     return 1
 }
 
-# Return 1 if alloca is supported, 0 otherwise.
+# Return 1 if dynamic stack allocation is supported, 0 otherwise.
 
 proc check_effective_target_alloca {} {
     if { [istarget bpf-*-*] } {