public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: David Malcolm <dmalcolm@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-5329] analyzer: don't assume target has alloca [PR102779] Date: Wed, 17 Nov 2021 02:00:34 +0000 (GMT) [thread overview] Message-ID: <20211117020034.D2965385840A@sourceware.org> (raw) https://gcc.gnu.org/g:a80d4e098b10d5cd161f55e4fce64a6be9683ed3 commit r12-5329-ga80d4e098b10d5cd161f55e4fce64a6be9683ed3 Author: David Malcolm <dmalcolm@redhat.com> Date: Mon Nov 15 18:23:08 2021 -0500 analyzer: don't assume target has alloca [PR102779] gcc/testsuite/ChangeLog: PR analyzer/102779 * gcc.dg/analyzer/capacity-1.c: Add dg-require-effective-target alloca. Use __builtin_alloca rather than alloca. * gcc.dg/analyzer/capacity-3.c: Likewise. Signed-off-by: David Malcolm <dmalcolm@redhat.com> Diff: --- gcc/testsuite/gcc.dg/analyzer/capacity-1.c | 4 +++- gcc/testsuite/gcc.dg/analyzer/capacity-3.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.dg/analyzer/capacity-1.c b/gcc/testsuite/gcc.dg/analyzer/capacity-1.c index 9ea41f72e1d..2d124833296 100644 --- a/gcc/testsuite/gcc.dg/analyzer/capacity-1.c +++ b/gcc/testsuite/gcc.dg/analyzer/capacity-1.c @@ -1,3 +1,5 @@ +/* { dg-require-effective-target alloca } */ + #include <stdlib.h> #include "analyzer-decls.h" @@ -53,7 +55,7 @@ test_malloc (void) void test_alloca (size_t sz) { - void *p = alloca (sz); + void *p = __builtin_alloca (sz); __analyzer_dump_capacity (p); /* { dg-warning "capacity: 'INIT_VAL\\(sz_\[^\n\r\]*\\)'" } */ } diff --git a/gcc/testsuite/gcc.dg/analyzer/capacity-3.c b/gcc/testsuite/gcc.dg/analyzer/capacity-3.c index 41e282cee92..c099ff5725d 100644 --- a/gcc/testsuite/gcc.dg/analyzer/capacity-3.c +++ b/gcc/testsuite/gcc.dg/analyzer/capacity-3.c @@ -1,10 +1,12 @@ +/* { dg-require-effective-target alloca } */ + #include <stdlib.h> #include "analyzer-decls.h" static void __attribute__((noinline)) __analyzer_callee_1 (size_t inner_sz) { - void *p = alloca (inner_sz); + void *p = __builtin_alloca (inner_sz); __analyzer_dump_capacity (p); /* { dg-warning "capacity: 'INIT_VAL\\(outer_sz_\[^\n\r\]*\\)'" } */ }
reply other threads:[~2021-11-17 2:00 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20211117020034.D2965385840A@sourceware.org \ --to=dmalcolm@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).