Hi,

The patch adds space for the string terminator, as the function is called
with test_strcpy_strcmp_abc ("abcd")

ChangeLog

gcc/testsuite

2020-02-18  Jon Beniston <j...@beniston.com>

        * gcc.dg/strcmpopt_6.c: Add space in array for terminator.

diff --git a/gcc/testsuite/gcc.dg/strcmpopt_6.c
b/gcc/testsuite/gcc.dg/strcmpopt_6.c
index cb99294e5fa..06b7e3480db 100644
--- a/gcc/testsuite/gcc.dg/strcmpopt_6.c
+++ b/gcc/testsuite/gcc.dg/strcmpopt_6.c
@@ -33,7 +33,7 @@ test_strlen_lt6_strcmp_abcd (const char *s)
 __attribute__ ((noclone, noinline)) int
 test_strcpy_strcmp_abc (const char *s)
 {
-  char a[4];
+  char a[5];
   strcpy (a, s);
   return strcmp (a, "abc") == 0;
 }


Reply via email to