From: Martin Sebor Date: Fri, 23 Aug 2019 15:57:46 +0000 (+0000) Subject: Warray-bounds-36.c: Make functions static to avoid failures with -fpic. X-Git-Tag: misc/cutover-git~3124 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=8e7803e8e11fecfae460e7076ac559f4ba35f2b5;p=thirdparty%2Fgcc.git Warray-bounds-36.c: Make functions static to avoid failures with -fpic. gcc/testsuite/ChangeLog: * gcc.dg/Warray-bounds-36.c: Make functions static to avoid failures with -fpic. * gcc.dg/Warray-bounds-41.c: Same. From-SVN: r274859 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index ad5aa69ebda3..2bd6d62eae4f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2019-08-23 Martin Sebor + + * gcc.dg/Warray-bounds-36.c: Make functions static to avoid failures + with -fpic. + * gcc.dg/Warray-bounds-41.c: Same. + 2019-08-22 Marek Polacek PR c++/91304 - prefix attributes ignored in condition. diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-36.c b/gcc/testsuite/gcc.dg/Warray-bounds-36.c index 35b3c9299c70..c47d7815c33b 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds-36.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds-36.c @@ -3,15 +3,15 @@ { dg-do compile } { dg-options "-O2 -Wall" } */ -int deref (const int *p, int i) +static int deref (const int *p, int i) { - return p[i]; // { dg-warning "array subscript \\\[3, \[0-9\]+] is outside array bounds of .int\\\[2\\\]." "ilp33" { xfail ilp32 } } + return p[i]; // { dg-warning "array subscript \\\[3, \[0-9\]+] is outside array bounds of .int\\\[2\\\]." "ilp32" { xfail ilp32 } } // There should also be an inlining context here. PR 86650 tracks // its absence. } -int deref_3_plus (const int *p, int i) +static int deref_3_plus (const int *p, int i) { if (i < 3) i = 3; diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-41.c b/gcc/testsuite/gcc.dg/Warray-bounds-41.c index 2ff3692854c5..3b3693f088a7 100644 --- a/gcc/testsuite/gcc.dg/Warray-bounds-41.c +++ b/gcc/testsuite/gcc.dg/Warray-bounds-41.c @@ -3,7 +3,7 @@ { dg-require-effective-target alloca } { dg-options "-O2 -Wall" } */ -void* vptr (void *c) +static void* vptr (void *c) { return c; } @@ -31,4 +31,3 @@ void test_vptr_arith_vla_var (int n) char c[n]; sink (vptr (c) - 1); /* { dg-warning "\\\[-Warray-bounds" "pr82608" { xfail *-*-* } } */ } -