OSDN Git Service

* snprintf-chk.c (ptr): Declare volatile.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 5 Dec 2010 00:29:52 +0000 (00:29 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 5 Dec 2010 00:29:52 +0000 (00:29 +0000)
* 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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@167466 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtins/snprintf-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/sprintf-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/strncpy-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/vsnprintf-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/vsprintf-chk.c

index 2cea754..ab9f955 100644 (file)
@@ -1,3 +1,11 @@
+2010-12-04  Jan Hubicka  <jh@suse.cz>
+
+       * 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.
+
 2010-12-04  Tobias Burnus  <burnus@net-b.de>
 
        PR fortran/46584
index e6ddc08..b244f89 100644 (file)
@@ -21,7 +21,7 @@ char *s3 = "FGH";
 char *s4;
 size_t l1 = 1;
 static char buffer[32];
-char *ptr = "barf";
+char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made.  */ 
 
 void
 __attribute__((noinline))
index 2862ab6..8a28362 100644 (file)
@@ -20,7 +20,7 @@ char *s3 = "FGH";
 char *s4;
 size_t l1 = 1;
 static char buffer[32];
-char *ptr = "barf";
+char * volatile ptr = "barf"; /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 void
 __attribute__((noinline))
index 46f3374..9e10dba 100644 (file)
@@ -16,10 +16,10 @@ extern void *memset (void *, int, size_t);
 
 const char s1[] = "123";
 char p[32] = "";
-char *s2 = "defg";
-char *s3 = "FGH";
+char * volatile s2 = "defg";  /* prevent constant propagation to happen when whole program assumptions are made.  */
+char * volatile s3 = "FGH";  /* prevent constant propagation to happen when whole program assumptions are made.  */
 char *s4;
-size_t l1 = 1;
+volatile size_t l1 = 1;  /* prevent constant propagation to happen when whole program assumptions are made.  */
 int i;
 
 void
index 8c7d72f..8a3f372 100644 (file)
@@ -22,7 +22,7 @@ char *s3 = "FGH";
 char *s4;
 size_t l1 = 1;
 static char buffer[32];
-char *ptr = "barf";
+char * volatile ptr = "barf";  /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 int
 __attribute__((noinline))
index 5c15090..5649b9e 100644 (file)
@@ -22,7 +22,7 @@ char *s3 = "FGH";
 char *s4;
 size_t l1 = 1;
 static char buffer[32];
-char *ptr = "barf";
+char * volatile ptr = "barf";  /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 int
 __attribute__((noinline))