Blame SOURCES/glibc-rh1505492-uninit-3.patch

00db10
commit b1eda10e17bf2056ca79a534d92fe0b0b06bd410
00db10
Author: Paul Eggert <eggert@cs.ucla.edu>
00db10
Date:   Tue Nov 25 14:12:48 2014 -0800
00db10
00db10
    fnmatch: work around GCC compiler warning bug with uninit var
00db10
    
00db10
    * posix/fnmatch_loop.c (FCT): Use a scalar not a one-item array.
00db10
    This works around a bug with x86-64 GCC 4.9.2 and earlier
00db10
    where 'gcc -O2 -Wmaybe-uninitialized' incorrectly complains
00db10
    "../locale/weightwc.h:93:7: warning: '*((void *)&str+4)' may be
00db10
    used uninitialized in this function [-Wmaybe-uninitialized]".
00db10
00db10
diff --git a/posix/fnmatch_loop.c b/posix/fnmatch_loop.c
00db10
index e289f451cc23c1ee..2bd788f3942c6e7d 100644
00db10
--- a/posix/fnmatch_loop.c
00db10
+++ b/posix/fnmatch_loop.c
00db10
@@ -342,7 +342,12 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
00db10
 #ifdef _LIBC
00db10
 		else if (c == L('[') && *p == L('='))
00db10
 		  {
00db10
-		    UCHAR str[1];
00db10
+		    /* It's important that STR be a scalar variable rather
00db10
+		       than a one-element array, because GCC (at least 4.9.2
00db10
+		       -O2 on x86-64) can be confused by the array and
00db10
+		       diagnose a "used initialized" in a dead branch in the
00db10
+		       findidx function.  */
00db10
+		    UCHAR str;
00db10
 		    uint32_t nrules =
00db10
 		      _NL_CURRENT_WORD (LC_COLLATE, _NL_COLLATE_NRULES);
00db10
 		    const CHAR *startp = p;
00db10
@@ -354,7 +359,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
00db10
 			c = L('[');
00db10
 			goto normal_bracket;
00db10
 		      }
00db10
-		    str[0] = c;
00db10
+		    str = c;
00db10
 
00db10
 		    c = *++p;
00db10
 		    if (c != L('=') || p[1] != L(']'))
00db10
@@ -367,7 +372,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
00db10
 
00db10
 		    if (nrules == 0)
00db10
 		      {
00db10
-			if ((UCHAR) *n == str[0])
00db10
+			if ((UCHAR) *n == str)
00db10
 			  goto matched;
00db10
 		      }
00db10
 		    else
00db10
@@ -382,7 +387,7 @@ FCT (pattern, string, string_end, no_leading_period, flags, ends, alloca_used)
00db10
 # endif
00db10
 			const int32_t *indirect;
00db10
 			int32_t idx;
00db10
-			const UCHAR *cp = (const UCHAR *) str;
00db10
+			const UCHAR *cp = (const UCHAR *) &str;
00db10
 
00db10
 			/* This #include defines a local function!  */
00db10
 # if WIDE_CHAR_VERSION