public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c
@ 2022-11-23 13:27 Rainer Orth
  2022-11-23 14:58 ` David Malcolm
  0 siblings, 1 reply; 2+ messages in thread
From: Rainer Orth @ 2022-11-23 13:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: David Malcolm

[-- Attachment #1: Type: text/plain, Size: 1191 bytes --]

gcc.dg/analyzer/call-summaries-2.c currently FAILs on Solaris:

FAIL: gcc.dg/analyzer/call-summaries-2.c (test for excess errors)

Excess errors:
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c:468:12: warning: implicit declaration of function 'alloca' [-Wimplicit-function-declaration]
/vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c:468:12: warning: incompatible implicit decl

alloca is only declared in <alloca.h>, which isn't included indirectly
anywhere.  To avoid this, I switched the test to use __builtin_alloca
instead, following the vast majority of analyzer tests that use alloca.

Tested no i386-pc-solaris2.11, sparc-sun-solaris2.11, and
x86_64-pc-linux-gnu.

Ok for trunk?

There are a handful of tests that explicitly include <alloca.h> instead,
which is of course an alternative if preferred.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University


2022-11-23  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	gcc/testsuite:
	* gcc.dg/analyzer/call-summaries-2.c (uses_alloca): Use
	__builtin_alloca instead of alloca.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: cs2.patch --]
[-- Type: text/x-patch, Size: 421 bytes --]

diff --git a/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c b/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c
--- a/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c
+++ b/gcc/testsuite/gcc.dg/analyzer/call-summaries-2.c
@@ -465,7 +465,7 @@ int test_returns_external_result (void)
 
 int uses_alloca (int i)
 {
-  int *p = alloca (sizeof (int));
+  int *p = __builtin_alloca (sizeof (int));
   *p = i;
   return *p;
 }

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c
  2022-11-23 13:27 [PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c Rainer Orth
@ 2022-11-23 14:58 ` David Malcolm
  0 siblings, 0 replies; 2+ messages in thread
From: David Malcolm @ 2022-11-23 14:58 UTC (permalink / raw)
  To: Rainer Orth, gcc-patches

On Wed, 2022-11-23 at 14:27 +0100, Rainer Orth wrote:
> gcc.dg/analyzer/call-summaries-2.c currently FAILs on Solaris:
> 
> FAIL: gcc.dg/analyzer/call-summaries-2.c (test for excess errors)
> 
> Excess errors:
> /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call-
> summaries-2.c:468:12: warning: implicit declaration of function
> 'alloca' [-Wimplicit-function-declaration]
> /vol/gcc/src/hg/master/local/gcc/testsuite/gcc.dg/analyzer/call-
> summaries-2.c:468:12: warning: incompatible implicit decl
> 
> alloca is only declared in <alloca.h>, which isn't included
> indirectly
> anywhere.  To avoid this, I switched the test to use __builtin_alloca
> instead, following the vast majority of analyzer tests that use
> alloca.
> 
> Tested no i386-pc-solaris2.11, sparc-sun-solaris2.11, and
> x86_64-pc-linux-gnu.
> 
> Ok for trunk?

Yes

Thanks
Dave

> 
> There are a handful of tests that explicitly include <alloca.h>
> instead,
> which is of course an alternative if preferred.
> 
>         Rainer
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-11-23 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-23 13:27 [PATCH] analyzer: Use __builtin_alloca in gcc.dg/analyzer/call-summaries-2.c Rainer Orth
2022-11-23 14:58 ` David Malcolm

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).