gcc/ * tree-chkp.c (chkp_find_const_bounds_var): Remove. (chkp_make_static_const_bounds): Search existing symbol by assembler name. Use make_decl_one_only. (chkp_get_zero_bounds_var): Remove node search which is now performed in chkp_make_static_const_bounds. (chkp_get_none_bounds_var): Likewise. gcc/testsuite/ * gcc.dg/lto/chkp-static-bounds_0.c: New. From-SVN: r221932
27 lines
487 B
C
27 lines
487 B
C
/* { dg-lto-do link } */
|
|
/* { dg-require-effective-target mpx } */
|
|
/* { dg-lto-options { { -flto -flto-partition=max -fcheck-pointer-bounds -mmpx } } } */
|
|
|
|
const char *cc;
|
|
|
|
int test1 (const char *c)
|
|
{
|
|
c = __builtin___bnd_init_ptr_bounds (c);
|
|
cc = c;
|
|
return c[0] * 2;
|
|
}
|
|
|
|
struct S
|
|
{
|
|
int (*fnptr) (const char *);
|
|
} S;
|
|
|
|
struct S s1 = {test1};
|
|
struct S s2 = {test1};
|
|
struct S s3 = {test1};
|
|
|
|
int main (int argc, const char **argv)
|
|
{
|
|
return s1.fnptr (argv[0]) + s2.fnptr (argv[1]);
|
|
}
|