I don't recall which port complained, but pr120654.c was failing on one or more of the embedded targets due to the use of malloc/free. This change just turns them into the __builtin variants which makes everyone happy again.

Pushing to the trunk.

jeff
commit 477abe67d34f7f8d1b0b12408e08769995b6ca9e
Author: Jeff Law <j...@ventanamicro.com>
Date:   Mon Jul 7 20:48:17 2025 -0600

    [committed] Minor fix to gcc.dg/torture/pr120654.c
    
    I don't recall which port complained, but pr120654.c was failing on one or 
more
    of the embedded targets due to the use of malloc/free.  This change just 
turns
    them into the __builtin variants which makes everyone happy again.
    
    gcc/testsuite
            * gcc.dg/torture/pr120654.c: Use __builtin variants of malloc and 
free.

diff --git a/gcc/testsuite/gcc.dg/torture/pr120654.c 
b/gcc/testsuite/gcc.dg/torture/pr120654.c
index 3819b78281d..aacfeea29c9 100644
--- a/gcc/testsuite/gcc.dg/torture/pr120654.c
+++ b/gcc/testsuite/gcc.dg/torture/pr120654.c
@@ -2,8 +2,6 @@
 
 int a, c, e, f, h, j;
 long g, k;
-void *malloc(long);
-void free(void *);
 int b(int m) {
   if (m || a)
     return 1;
@@ -16,9 +14,9 @@ int i() {
 }
 void n() {
   long o;
-  int *p = malloc(sizeof(int));
+  int *p = __builtin_malloc(sizeof(int));
   k = 1 % j;
   for (; i() + f + h; o++)
     if (p[d(j + 6, (int)k + 1992695866) + h + f + j + (int)k - 1 + o])
-      free(p);
+      __builtin_free(p);
 }

Reply via email to