]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
gcc/testsuite/ChangeLog:
authormsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Jul 2019 19:39:04 +0000 (19:39 +0000)
committermsebor <msebor@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 25 Jul 2019 19:39:04 +0000 (19:39 +0000)
* gcc.dg/Wstringop-overflow-14.c: Disable for stricly aligned targets.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@273814 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/Wstringop-overflow-14.c

index b395a9afff1dd68dacea663a5997129a11cd02b5..f1f1cbe37e6f38e83937bcf654e2907259a62dfe 100644 (file)
@@ -2,6 +2,7 @@
 
        PR tree-optimization/91183
        PR tree-optimization/86688
+       * gcc.dg/Wstringop-overflow-14.c: Disable for stricly aligned targets.
        * gcc.dg/strlenopt-70.c: Fix bugs.
        * gcc.dg/strlenopt-71.c: Same.
        * gcc.dg/strlenopt-72.c: Same.
index d23a248446bf9382c015a76cd8c48d7a29ec0847..d6201b068b6399c9f670b2a80f0a76ab16279492 100644 (file)
@@ -2,7 +2,7 @@
    types than char are diagnosed.
    { dg-do compile }
    { dg-require-effective-target int32plus }
-   { dg-options "-O2 -Wall" } */
+   { dg-options "-O2 -Wall -Wno-array-bounds" } */
 
 typedef __INT16_TYPE__  int16_t;
 typedef __INT32_TYPE__  int32_t;
@@ -21,6 +21,13 @@ void test_memcpy_cond (int i)
 {
   char *p = a4 + 1;
   const char *q = i ? s4 : t4;
+  // On strictly aligned target the call below is left unchanged and
+  // triggers (inaccurately) a -Warray-bounds.  The test suppresses
+  // the warning above, which then lets -Wstringop-overrflow detect
+  // the overflow just before expansion.
+  // On other targets it's transformed into a store of a 4-byte integer
+  // which is detected by -Wstringop-overrflow in the strlen pass (i.e.,
+  // before it gets to expansion).
   memcpy (p, q, 4);         // { dg-warning "writing 4 bytes into a region of size 3" }
 }