Patchwork Fix gcc.dg/shrink-wrap-alloca.c

login
register
mail settings
Submitter Rainer Orth
Date May 31, 2013, 11:28 a.m.
Message ID <yddtxljpewp.fsf@lokon.CeBiTec.Uni-Bielefeld.DE>
Download mbox | patch
Permalink /patch/247929/
State New
Headers show

Comments

Rainer Orth - May 31, 2013, 11:28 a.m.
The new gcc.dg/shrink-wrap-alloca.c FAILs on 64-bit Solaris 10/x86:

Excess errors:
/vol/gcc/src/hg/trunk/local/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c:4:14: warning: conflicting types for built-in function 'alloca' [enabled by default]

The following patch fixes it by using __builtin_alloca, as pre-approved
by Jeff.

Tested with the appropriate runtest invocation on i386-pc-solaris2.10
and x86_64-unknown-linux-gnu, installed on mainline.

	Rainer


2013-05-31  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* gcc.dg/shrink-wrap-alloca.c: Use __builtin_alloca.

Patch

# HG changeset patch
# Parent aa3c5278ae7a82849942b6f47fc69ee62b244660
Fix gcc.dg/shrink-wrap-alloca.c

diff --git a/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c b/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
--- a/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
+++ b/gcc/testsuite/gcc.dg/shrink-wrap-alloca.c
@@ -1,13 +1,11 @@ 
 /* { dg-do compile } */
 /* { dg-options "-O2 -g" } */
 
-extern int * alloca (int);
-
 int *p;
 
 void
 test (int a)
 {
   if (a > 0)
-    p = alloca (4);
+    p = __builtin_alloca (4);
 }