This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Fix builtins/*-chk.c testcases for -fuse-linker-plugin
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: gcc-patches at gcc dot gnu dot org, rguenther at usse dot de
- Date: Wed, 1 Dec 2010 19:40:10 +0100
- Subject: Fix builtins/*-chk.c testcases for -fuse-linker-plugin
Hi,
these testcases are optimized little too much, so some *_chk calls are optimized
away that should not be. The use of externally visible vars is not good enough
since we bring them static and constant propagate.
regtested x86_64-linux, OK?
Honza
* snprintf-chk.c (ptr): Declare volatile.
* strcpy-chk.c (s2, s3, l1): Declare volatile.
* snprintf-chk.c (ptr): Declare volatile.
* vsprintf-chk.c (ptr): Declare volatile.
* vsnprintf-chk.c (ptr): Declare volatile.
Index: snprintf-chk.c
===================================================================
*** snprintf-chk.c (revision 167242)
--- snprintf-chk.c (working copy)
*************** char *s3 = "FGH";
*** 21,27 ****
char *s4;
size_t l1 = 1;
static char buffer[32];
! char *ptr = "barf";
void
__attribute__((noinline))
--- 21,27 ----
char *s4;
size_t l1 = 1;
static char buffer[32];
! char * volatile ptr = "barf";
void
__attribute__((noinline))
Index: strncpy-chk.c
===================================================================
*** strncpy-chk.c (revision 167242)
--- strncpy-chk.c (working copy)
*************** extern void *memset (void *, int, size_t
*** 16,25 ****
const char s1[] = "123";
char p[32] = "";
! char *s2 = "defg";
! char *s3 = "FGH";
char *s4;
! size_t l1 = 1;
int i;
void
--- 16,25 ----
const char s1[] = "123";
char p[32] = "";
! char * volatile s2 = "defg";
! char * volatile s3 = "FGH";
char *s4;
! volatile size_t l1 = 1;
int i;
void
Index: sprintf-chk.c
===================================================================
*** sprintf-chk.c (revision 167242)
--- sprintf-chk.c (working copy)
*************** char *s3 = "FGH";
*** 20,26 ****
char *s4;
size_t l1 = 1;
static char buffer[32];
! char *ptr = "barf";
void
__attribute__((noinline))
--- 20,26 ----
char *s4;
size_t l1 = 1;
static char buffer[32];
! char * volatile ptr = "barf";
void
__attribute__((noinline))
Index: vsprintf-chk.c
===================================================================
*** vsprintf-chk.c (revision 167242)
--- vsprintf-chk.c (working copy)
*************** char *s3 = "FGH";
*** 22,28 ****
char *s4;
size_t l1 = 1;
static char buffer[32];
! char *ptr = "barf";
int
__attribute__((noinline))
--- 22,28 ----
char *s4;
size_t l1 = 1;
static char buffer[32];
! char * volatile ptr = "barf";
int
__attribute__((noinline))
Index: vsnprintf-chk.c
===================================================================
*** vsnprintf-chk.c (revision 167242)
--- vsnprintf-chk.c (working copy)
*************** char *s3 = "FGH";
*** 22,28 ****
char *s4;
size_t l1 = 1;
static char buffer[32];
! char *ptr = "barf";
int
__attribute__((noinline))
--- 22,28 ----
char *s4;
size_t l1 = 1;
static char buffer[32];
! char * volatile ptr = "barf";
int
__attribute__((noinline))