aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMartin Sebor <msebor@redhat.com>2019-07-25 19:39:04 +0000
committerMartin Sebor <msebor@gcc.gnu.org>2019-07-25 13:39:04 -0600
commit599780d601abd0e67814a07d9574cc00f227ea5e (patch)
treef74eb4ef688268eec5831317e778bc197adf02a4 /gcc
parentf2d52e0042fb5027ae6f8af48e39071648c6b65e (diff)
downloadgcc-599780d601abd0e67814a07d9574cc00f227ea5e.zip
gcc-599780d601abd0e67814a07d9574cc00f227ea5e.tar.gz
gcc-599780d601abd0e67814a07d9574cc00f227ea5e.tar.bz2
Wstringop-overflow-14.c: Disable for stricly aligned targets.
gcc/testsuite/ChangeLog: * gcc.dg/Wstringop-overflow-14.c: Disable for stricly aligned targets. From-SVN: r273814
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog1
-rw-r--r--gcc/testsuite/gcc.dg/Wstringop-overflow-14.c9
2 files changed, 9 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b395a9a..f1f1cbe 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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.
diff --git a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
index d23a248..d6201b0 100644
--- a/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
+++ b/gcc/testsuite/gcc.dg/Wstringop-overflow-14.c
@@ -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" }
}