This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite] Fix gcc.dg/fstack-protector-strong.c on Solaris/x86
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Jeff Law <law at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 14 May 2013 15:13:13 +0200
- Subject: Re: [testsuite] Fix gcc.dg/fstack-protector-strong.c on Solaris/x86
- References: <ydd38tp502w dot fsf at lokon dot CeBiTec dot Uni-Bielefeld dot DE> <20130514103129 dot GO1377 at tucnak dot redhat dot com> <5192352E dot 8010101 at redhat dot com>
Jeff Law <law@redhat.com> writes:
> On 05/14/2013 04:31 AM, Jakub Jelinek wrote:
>> On Tue, May 14, 2013 at 12:26:31PM +0200, Rainer Orth wrote:
>>> Tested with the appropriate runtest invocations on i386-pc-solaris2.11
>>> and x86_64-unknown-linux-gnu, installed on mainline.
>>
>> I'd say the test should just use __builtin_alloca instead.
> Yea, let's go with that. OK with that fix. I
Here's what I installed, tested as before:
2013-05-14 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* gcc.dg/fstack-protector-strong.c: Don't include <stdlib.h>.
(alloca): Remove declaration.
(foo9): Replace alloca by __builtin_alloca.
changeset: 7864:f9b5472f0ad7
tag: tip
user: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
date: Tue May 14 15:10:31 2013 +0200
summary: Use __builtin_alloca in gcc.dg/fstack-protector-strong.c
diff --git a/gcc/testsuite/gcc.dg/fstack-protector-strong.c b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
--- a/gcc/testsuite/gcc.dg/fstack-protector-strong.c
+++ b/gcc/testsuite/gcc.dg/fstack-protector-strong.c
@@ -4,9 +4,6 @@
/* { dg-options "-O2 -fstack-protector-strong" } */
#include<string.h>
-#include<stdlib.h>
-
-extern void *alloca(__SIZE_TYPE__);
extern int g0;
extern int* pg0;
@@ -112,7 +109,7 @@ foo8 ()
int
foo9 ()
{
- char* p = alloca (100);
+ char* p = __builtin_alloca (100);
return goo ((int *)(p + 50));
}
> Ranier, if you run into others, they're pre-approved to be fixed this way
> as well.
The one above is the only one that currently fails on Solaris.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University