On 2/18/20 9:55 AM, Jon Beniston wrote:
Hi,
The patch adds space for the string terminator, as the function is called
with test_strcpy_strcmp_abc ("abcd")
That looks right. Please go ahead and commit it.
Thanks!
Martin
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;
}