[committed] Fix up gcc.target/i386/pr71801.c testcase

Jakub Jelinek jakub@redhat.com
Mon Oct 7 15:52:00 GMT 2019


Hi!

This testcase started FAILing on i?86-linux with r276603 (the -O2 inlining
changes):
/home/jakub/src/gcc/gcc/testsuite/gcc.target/i386/pr71801.c:12:3: warning: writing 24 bytes into a region of size 1 [-Wstringop-overflow=]
/home/jakub/src/gcc/gcc/testsuite/gcc.target/i386/pr71801.c:14:5: warning: writing 24 bytes into a region of size 1 [-Wstringop-overflow=]
Previously the function call wasn't inlined and thus it didn't warn
that it is in fact invalid.
The following patch makes it valid, and it still ICEs with r238210 the same
way as the incorrect testcase, and succeeds with r238211, so I've committed
this as obvious to trunk.

2019-10-07  Jakub Jelinek  <jakub@redhat.com>

	* gcc.target/i386/pr71801.c (uuidcache_init): Fix up size of d array.

--- gcc/testsuite/gcc.target/i386/pr71801.c.jj	2016-07-11 22:18:04.470879189 +0200
+++ gcc/testsuite/gcc.target/i386/pr71801.c	2019-10-07 17:39:44.310698244 +0200
@@ -16,7 +16,7 @@ static int get_label_uuid(char *p1) {
 }
 void uuidcache_addentry(char *p1) { __builtin_memcpy(&c, p1, sizeof(c)); }
 void uuidcache_init() {
-  char d[1];
+  char d[sizeof(a) + sizeof(c)];
   get_label_uuid(d);
   uuidcache_addentry(d);
 }

	Jakub



More information about the Gcc-patches mailing list