https://gcc.gnu.org/g:e8d104ba967635f041d0e5dd15edbc147a10d11c

commit r17-5552-ge8d104ba967635f041d0e5dd15edbc147a10d11c
Author: John David Anglin <[email protected]>
Date:   Sat Oct 24 17:12:18 2026 -0400

    testsuite: Fix fwrite-3.c scan-tree-dump failure on hppa*-*-hpux*
    
    The test gcc.dg/fwrite-3.c expects a single-byte 'fwrite_unlocked'
    call to be optimized and folded into 'fputc_unlocked'.  While the
    hppa*-*-hpux* runtime environment provides 'fwrite_unlocked', it
    lacks 'fputc_unlocked'.  As a result, this optimization path is
    bypassed by the compiler, leading to a tree dump mismatch.
    
    This patch restricts the 'fputc_unlocked' scan-tree-dump-times check
    to exclude hppa*-*-hpux* targets.
    
    2026-10-24  John David Anglin  <[email protected]>
    
    gcc/testsuite/ChangeLog:
    
            * gcc.dg/fwrite-3.c: Restrict fputc_unlocked tree dump scan to
            exclude hppa*-*-hpux* targets.

Diff:
---
 gcc/testsuite/gcc.dg/fwrite-3.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/testsuite/gcc.dg/fwrite-3.c b/gcc/testsuite/gcc.dg/fwrite-3.c
index 0fb9d0a234fb..c86d47f6bd1b 100644
--- a/gcc/testsuite/gcc.dg/fwrite-3.c
+++ b/gcc/testsuite/gcc.dg/fwrite-3.c
@@ -22,7 +22,7 @@ void two_items (FILE *f, const char *p) { fwrite_unlocked (p, 
1, 2, f); }
 void two_bytes (FILE *f, const char *p) { fwrite_unlocked (p, 2, 1, f); }
 void unknown (FILE *f, const char *p, size_t n) { fwrite_unlocked (p, 1, n, 
f); }
 
-/* { dg-final { scan-tree-dump-times "fputc_unlocked" 1 "optimized" } } */
+/* { dg-final { scan-tree-dump-times "fputc_unlocked" 1 "optimized" { target { 
! hppa*-*-hpux* } } } } */
 /* { dg-final { scan-tree-dump-times "fwrite_unlocked" 4 "optimized" } } */
 /* The unlocked form must not be folded into the locked fputc.  A call with no
    result is dumped as "  fputc (...", which the leading space matches without

Reply via email to