aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Schwinge <tschwinge@baylibre.com>2025-02-21 11:21:08 +0100
committerThomas Schwinge <tschwinge@baylibre.com>2025-02-22 22:37:50 +0100
commit2abc942fd486be217de1ba0282a3dc8e21d599aa (patch)
treee6e4eb4733492eaf3a8563ac9e945ef7b5fe7ba6
parente759ff08e2e2e7128db7e6313b4218daa367c74f (diff)
downloadgcc-2abc942fd486be217de1ba0282a3dc8e21d599aa.zip
gcc-2abc942fd486be217de1ba0282a3dc8e21d599aa.tar.gz
gcc-2abc942fd486be217de1ba0282a3dc8e21d599aa.tar.bz2
BPF, nvptx: Standardize on 'sorry, unimplemented: dynamic stack allocation not supported'
... 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.
-rw-r--r--gcc/config/bpf/bpf.md5
-rw-r--r--gcc/config/nvptx/nvptx.md2
-rw-r--r--gcc/testsuite/gcc.target/bpf/diag-alloca-1.c3
-rw-r--r--gcc/testsuite/gcc.target/bpf/diag-alloca-2.c4
-rw-r--r--gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c2
-rw-r--r--gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c2
-rw-r--r--gcc/testsuite/lib/target-supports.exp2
7 files changed, 11 insertions, 9 deletions
diff --git a/gcc/config/bpf/bpf.md b/gcc/config/bpf/bpf.md
index 12cf9fa..91d9483 100644
--- a/gcc/config/bpf/bpf.md
+++ b/gcc/config/bpf/bpf.md
@@ -121,12 +121,11 @@
[(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
diff --git a/gcc/config/nvptx/nvptx.md b/gcc/config/nvptx/nvptx.md
index d3d5380..e7d3630 100644
--- a/gcc/config/nvptx/nvptx.md
+++ b/gcc/config/nvptx/nvptx.md
@@ -1677,7 +1677,7 @@
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)
diff --git a/gcc/testsuite/gcc.target/bpf/diag-alloca-1.c b/gcc/testsuite/gcc.target/bpf/diag-alloca-1.c
index 0406f2c..e549cab 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-alloca-1.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-alloca-1.c
@@ -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];
}
diff --git a/gcc/testsuite/gcc.target/bpf/diag-alloca-2.c b/gcc/testsuite/gcc.target/bpf/diag-alloca-2.c
index ef7170b..b1084bf 100644
--- a/gcc/testsuite/gcc.target/bpf/diag-alloca-2.c
+++ b/gcc/testsuite/gcc.target/bpf/diag-alloca-2.c
@@ -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];
}
diff --git a/gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c b/gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c
index 261a603..5538751 100644
--- a/gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c
+++ b/gcc/testsuite/gcc.target/nvptx/alloca-1-sm_30.c
@@ -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 } */
}
diff --git a/gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c b/gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c
index 2bf2c91..7c2d2e0 100644
--- a/gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c
+++ b/gcc/testsuite/gcc.target/nvptx/vla-1-sm_30.c
@@ -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);
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 9b5fbe5..7eab76a 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -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-*-*] } {