Get builtins tests ready for linker plugin.
authorJan Hubicka <jh@suse.cz>
Fri, 7 Jan 2011 23:29:27 +0000 (00:29 +0100)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 7 Jan 2011 23:29:27 +0000 (23:29 +0000)
* gcc.c-torture/execute/builtins/memcpy-chk.c (s2,s3,l1): Mark volatile.
* gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memcpy, my_bcopy, my_memset,
my_bzero): Mark used.
* gcc.c-torture/execute/builtins/memset-chk.c (l1, l3): Mark volatile.
* gcc.c-torture/execute/builtins/memmove-chk.c (s1,s2,s3,l1): Mark volatile.
* gcc.c-torture/execute/builtins/mempcpy-chk.c (s2,s3,l1): Mark volatile

From-SVN: r168588

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/builtins/memcpy-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/memmove-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/memops-asm-lib.c
gcc/testsuite/gcc.c-torture/execute/builtins/mempcpy-chk.c
gcc/testsuite/gcc.c-torture/execute/builtins/memset-chk.c

index e91432e8dede13bd45a5d8b58ca0679a4bf53190..def943376257dbf964036515a33c8f13e6f1818e 100644 (file)
@@ -1,3 +1,13 @@
+2011-01-07  Jan Hubicka  <jh@suse.cz>
+
+       Get builtins tests ready for linker plugin.
+       * gcc.c-torture/execute/builtins/memcpy-chk.c (s2,s3,l1): Mark volatile.
+       * gcc.c-torture/execute/builtins/memops-asm-lib.c (my_memcpy, my_bcopy, my_memset,
+       my_bzero): Mark used.
+       * gcc.c-torture/execute/builtins/memset-chk.c (l1, l3): Mark volatile.
+       * gcc.c-torture/execute/builtins/memmove-chk.c (s1,s2,s3,l1): Mark volatile.
+       * gcc.c-torture/execute/builtins/mempcpy-chk.c (s2,s3,l1): Mark volatile
+
 2011-01-07  Jan Hubicka  <jh@suse.cz>
 
        PR tree-optimization/46367
index 28f7ae785f6d21a55d42808a95e7b7367cc5eb28..5b245e58e22b697f7050d5d2474ab14db6ff621c 100644 (file)
@@ -12,9 +12,9 @@ extern int memcmp (const void *, const void *, size_t);
 
 const char s1[] = "123";
 char p[32] = "";
-char *s2 = "defg";
-char *s3 = "FGH";
-size_t l1 = 1;
+volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 void
 __attribute__((noinline))
index 12272272ca6b7db942b5b8e7a971b73abc1fe3e3..73b35883ed1f88583de9a62a2ffa71ac8b01166d 100644 (file)
@@ -11,11 +11,11 @@ extern int memcmp (const void *, const void *, size_t);
 
 #include "chk.h"
 
-const char s1[] = "123";
+const char s1[] = "123"; 
 char p[32] = "";
-char *s2 = "defg";
-char *s3 = "FGH";
-size_t l1 = 1;
+volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 void
 __attribute__((noinline))
index eeffe5c08e49e0c35b61d9d8a8c4d9a4c358b3cd..00005298d10575c8209a5a49dd9c5eb91591b25a 100644 (file)
@@ -4,6 +4,9 @@ typedef __SIZE_TYPE__ size_t;
 
 #define TEST_ABORT if (inside_main) abort()
 
+/* LTO code is at the present to able to track that asm alias my_bcopy on builtin
+   actually refers to this function.  See PR47181. */
+__attribute__ ((used))
 void *
 my_memcpy (void *d, const void *s, size_t n)
 {
@@ -14,6 +17,9 @@ my_memcpy (void *d, const void *s, size_t n)
   return (char *) d;
 }
 
+/* LTO code is at the present to able to track that asm alias my_bcopy on builtin
+   actually refers to this function.  See PR47181. */
+__attribute__ ((used))
 void
 my_bcopy (const void *s, void *d, size_t n)
 {
@@ -31,6 +37,9 @@ my_bcopy (const void *s, void *d, size_t n)
     }
 }
 
+/* LTO code is at the present to able to track that asm alias my_bcopy on builtin
+   actually refers to this function.  See PR47181. */
+__attribute__ ((used))
 void *
 my_memset (void *d, int c, size_t n)
 {
@@ -40,6 +49,9 @@ my_memset (void *d, int c, size_t n)
   return (char *) d;
 }
 
+/* LTO code is at the present to able to track that asm alias my_bcopy on builtin
+   actually refers to this function.  See PR47181. */
+__attribute__ ((used))
 void
 my_bzero (void *d, size_t n)
 {
index a59d59bd85deacf435c15bcd07510c8523269aef..7a1737c4a8f611cd19383203aeff65db24b7ba76 100644 (file)
@@ -13,9 +13,9 @@ extern int memcmp (const void *, const void *, size_t);
 
 const char s1[] = "123";
 char p[32] = "";
-char *s2 = "defg";
-char *s3 = "FGH";
-size_t l1 = 1;
+volatile char *s2 = "defg"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile size_t l1 = 1; /* prevent constant propagation to happen when whole program assumptions are made.  */
 
 void
 __attribute__((noinline))
index a8f09a739312e83b53da092cd03bbe219df86360..902a8850382fe4fe471d672397b5de788fc14495 100644 (file)
@@ -13,8 +13,8 @@ extern int memcmp (const void *, const void *, size_t);
 
 char buffer[32];
 int argc = 1;
-size_t l1 = 1;
-char *s3 = "FGH";
+volatile size_t l1 = 1;  /* prevent constant propagation to happen when whole program assumptions are made.  */
+volatile char *s3 = "FGH"; /* prevent constant propagation to happen when whole program assumptions are made.  */
 char *s4;
 
 void