diff mbox series

[committed] xfail assertion in c-c++-common/Warray-bounds-3.c (PR 83462)

Message ID 763e24ff-525f-6888-7ca2-a2b4f9b7d473@gmail.com
State New
Headers show
Series [committed] xfail assertion in c-c++-common/Warray-bounds-3.c (PR 83462) | expand

Commit Message

Martin Sebor March 27, 2018, 5:15 p.m. UTC
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
diff mbox series

Patch

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
+
 }