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

commit r17-4880-gfadbd0d585193b7c899e4e4288de5bb18549ce46
Author: Avinash Jayakar <[email protected]>
Date:   Tue Sep 29 13:44:59 2026 +0530

    rs6000: (__builtin_atomic_cas_local) Initialize size of type to 0 in 
altivec_resolve_overloaded_builtin
    
    The bootstrap build with the following configure command:
    
    configure --enable-checking=release --enable-languages=c,c++,fortran
    
    failed since the maybe-uninitialized pass reported the 'size' variable
    to be unitialized before using it. This case is a false positive because
    the 'size' variable is accessed only from the second iteration in the
    loop at which time 'size' would have been initialized.
    
    This patch initializes this variable to 0 to get rid of this warning.
    
    2026-10-05  Avinash Jayakar  <[email protected]>
    
    gcc/ChangeLog:
            PR target/127632
            * config/rs6000/rs6000-c.cc (altivec_resolve_overloaded_builtin):
            Initialize size to 0.

Diff:
---
 gcc/config/rs6000/rs6000-c.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000-c.cc b/gcc/config/rs6000/rs6000-c.cc
index ecc3ff4e24e0..f51593e0455c 100644
--- a/gcc/config/rs6000/rs6000-c.cc
+++ b/gcc/config/rs6000/rs6000-c.cc
@@ -1734,7 +1734,7 @@ altivec_resolve_overloaded_builtin (location_t loc, tree 
fndecl,
            error_at (loc, "%qE requires 6 arguments", fndecl);
          return error_mark_node;
        }
-      unsigned HOST_WIDE_INT size;
+      unsigned HOST_WIDE_INT size = 0;
       for (int i=0; i<3; i++) {
        /* Get the first argument to determine the actual type.  */
        tree arg0 = (*arglist)[i];

Reply via email to