+2019-08-23 Martin Sebor <msebor@redhat.com>
+
+ * 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 <polacek@redhat.com>
PR c++/91304 - prefix attributes ignored in condition.
{ 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;
{ dg-require-effective-target alloca }
{ dg-options "-O2 -Wall" } */
-void* vptr (void *c)
+static void* vptr (void *c)
{
return c;
}
char c[n];
sink (vptr (c) - 1); /* { dg-warning "\\\[-Warray-bounds" "pr82608" { xfail *-*-* } } */
}
-