From patchwork Tue Jan 15 18:42:04 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [google, gcc-4_7] Backport r195207 (fix for PR55982) into google/gcc-4_7 Date: Tue, 15 Jan 2013 08:42:04 -0000 From: Paul Pluzhnikov X-Patchwork-Id: 212294 Message-Id: To: dnovillo@google.com, gcc-patches@gcc.gnu.org Cc: ppluzhnikov@google.com Ok for google/gcc-4_7 ? Ref b/8003094 Thanks, --- Paul Pluzhnikov 2013-01-15 Paul Pluzhnikov PR 55982 * strncat-chk.c (__strncat_chk): Fix loop unroll. Index: libssp/strncat-chk.c =================================================================== --- libssp/strncat-chk.c (revision 195212) +++ libssp/strncat-chk.c (working copy) @@ -87,12 +87,6 @@ __strncat_chk (char *__restrict__ dest, const char *++dest = c; if (c == '\0') return s; - if (slen-- == 0) - __chk_fail (); - c = *src++; - *++dest = c; - if (c == '\0') - return s; } while (--n4 > 0); n &= 3; }