This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Tweak a couple of testcases
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 10 Nov 2009 18:30:31 +0100
- Subject: Tweak a couple of testcases
gcc.c-torture/execute/ipa-sra-2.c doesn't pass on SPARC64/Solaris 10 because
it returns a value read from uninitialized memory. gcc.dg/pr41963.c doesn't
pass on SPARC/Solaris 9 because of a missing declaration for fabsf.
Tested on SPARC/Solaris 9, SPARC64/Solaris 10 and x86/Linux, applied on the
mainline as obvious.
2009-11-10 Eric Botcazou <ebotcazou@adacore.com>
* gcc.c-torture/execute/ipa-sra-2.c: Use calloc instead of malloc.
* gcc.dg/pr41963.c: Do not include math.h. Declare fabsf manually.
--
Eric Botcazou
Index: gcc.c-torture/execute/ipa-sra-2.c
===================================================================
--- gcc.c-torture/execute/ipa-sra-2.c (revision 154059)
+++ gcc.c-torture/execute/ipa-sra-2.c (working copy)
@@ -14,11 +14,10 @@ union both
struct small small;
};
-extern void *malloc(__SIZE_TYPE__);
+extern void *calloc (__SIZE_TYPE__, __SIZE_TYPE__);
extern void free (void *);
-static int
-__attribute__((noinline))
+static int __attribute__((noinline))
foo (int fail, union both *agg)
{
int r;
@@ -31,7 +30,7 @@ foo (int fail, union both *agg)
int main (int argc, char *argv[])
{
- union both *agg = malloc (sizeof (struct small));
+ union both *agg = calloc (1, sizeof (struct small));
int r;
r = foo ((argc > 2000), agg);
Index: gcc.dg/pr41963.c
===================================================================
--- gcc.dg/pr41963.c (revision 154059)
+++ gcc.dg/pr41963.c (working copy)
@@ -1,7 +1,7 @@
/* { dg-do run } */
/* { dg-options "-O2 -ffast-math" } */
-#include <math.h>
+extern float fabsf(float);
extern float sqrtf(float);
static __attribute__((noinline)) void f (float *dst, float *src)