This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] xfail assertion in c-c++-common/Warray-bounds-3.c (PR 83462)
- From: Martin Sebor <msebor at gmail dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 27 Mar 2018 11:15:53 -0600
- Subject: [committed] xfail assertion in c-c++-common/Warray-bounds-3.c (PR 83462)
An assertion in the test fails on a number of targets due to
a missing strlen optimization. I plan to add the optimization
for GCC 9 but it's too late to add it now. To prevent the
failure r258896 disables and xfails the assertion for targets
other than x86. Attached is the change for reference.
I tested the change with a native x86_64-linux compiler and
with a powerpc64le-linux cross-compiler.
Martin
Index: gcc/testsuite/c-c++-common/Warray-bounds-4.c
===================================================================
--- gcc/testsuite/c-c++-common/Warray-bounds-4.c (revision 258895)
+++ gcc/testsuite/c-c++-common/Warray-bounds-4.c (working copy)
@@ -64,5 +64,10 @@ void test_strcpy_bounds_memarray_range (void)
TM ("01", "", ma.a5 + i, ma.a5);
TM ("012", "", ma.a5 + i, ma.a5);
TM ("0123", "", ma.a5 + i, ma.a5); /* { dg-warning "offset 6 from the object at .ma. is out of the bounds of referenced subobject .a5. with type .char\\\[5]. at offset 0" "strcpy" { xfail *-*-* } } */
- TM ("", "012345", ma.a7 + i, ma.a7); /* { dg-warning "offset 13 from the object at .ma. is out of the bounds of referenced subobject .\(MA::\)?a7. with type .char ?\\\[7]. at offset 5" "strcpy" { xfail sparc*-*-* visium-*-* } } */
+
+#if __i386__ || __x86_64__
+ /* Disabled for non-x86 targets due to bug 83462. */
+ TM ("", "012345", ma.a7 + i, ma.a7); /* { dg-warning "offset 13 from the object at .ma. is out of the bounds of referenced subobject .\(MA::\)?a7. with type .char ?\\\[7]. at offset 5" "strcpy" { xfail { ! { i?86-*-* x86_64-*-* } } } } */
+#endif
+
}