[gcc r17-2441] testsuite: Fix gcc.dg/vect/tsvc tests on NetBSD

Rainer Orth via Gcc-cvs <[email protected]>
Newsgroups gmane.comp.gcc.cvs
Message-ID <[email protected]>
https://gcc.gnu.org/g:19888932d149c9df18306544d5b0ad0e38f2a6fe

commit r17-2441-g19888932d149c9df18306544d5b0ad0e38f2a6fe
Author: Rainer Orth <[email protected]>
Date:   Thu Jul 16 10:14:54 2026 +0200

    testsuite: Fix gcc.dg/vect/tsvc tests on NetBSD
    
    All gcc.dg/vect/tsvc tests FAIL on NetBSD like
    
    FAIL: gcc.dg/vect/tsvc/vect-tsvc-s000.c (test for excess errors)
    UNRESOLVED: gcc.dg/vect/tsvc/vect-tsvc-s000.c compilation failed to produce executable
    UNRESOLVED: gcc.dg/vect/tsvc/vect-tsvc-s000.c scan-tree-dump-times vect "vectorized 1 loops" 1
    
    Excess errors:
    gcc.dg/vect/tsvc/tsvc.h:199:20: error: implicit declaration of function 'memalign' [-Wimplicit-function-declaration]
    gcc.dg/vect/tsvc/tsvc.h:199:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    gcc.dg/vect/tsvc/tsvc.h:200:11: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
    
    While NetBSD lacks memalign, it has posix_memalign instead.
    
    Tested on amd64-pc-netbsd10.1 and i386-pc-solaris2.11.
    
    2026-07-16  Rainer Orth  <[email protected]>
    
            gcc/testsuite:
            * gcc.dg/vect/tsvc/tsvc.h (init): Don't use memalign on NetBSD.

Diff:
---
 gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
index 4d295d1ec296..ead834dcb33d 100644
--- a/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
+++ b/gcc/testsuite/gcc.dg/vect/tsvc/tsvc.h
@@ -195,7 +195,7 @@ void set_2d_array(real_t arr[LEN_2D][LEN_2D], real_t value, int stride)
 }
 
 void init(int** ip, real_t* s1, real_t* s2){
-#if !defined (__APPLE__) && !defined (_AIX) && !defined(__DragonFly__)
+#if !defined (__APPLE__) && !defined (_AIX) && !defined(__DragonFly__) && !defined(__NetBSD__)
     xx = (real_t*) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
     *ip = (int *) memalign(ARRAY_ALIGNMENT, LEN_1D*sizeof(real_t));
 #else
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.