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

Message ID 20191007155153.GL15914@tucnak
State New
Headers show
Series
  • [committed] Fix up gcc.target/i386/pr71801.c testcase
Related show

Commit Message

Jakub Jelinek Oct. 7, 2019, 3:51 p.m. UTC
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.


	Jakub

Patch
diff mbox series

--- 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);
 }