diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG17.c b/gcc/testsuite/gcc.c-torture/compile/BUG17.c
index 920587046ed..28bfb8873d4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG17.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG17.c
@@ -1,6 +1,7 @@
 double d;
 
-main()
+int
+main(void)
 {
   int i;
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG18.c b/gcc/testsuite/gcc.c-torture/compile/BUG18.c
index ed586a7f9d6..d5f172916a9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG18.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG18.c
@@ -1,5 +1,6 @@
-main()
+int
+main(void)
 {
   if ((signed int) 1 < (signed int) -2147483648)
-    printf("true\n");
+    __builtin_printf("true\n");
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG21.c b/gcc/testsuite/gcc.c-torture/compile/BUG21.c
index c8a1157cc46..0ce2a173dd8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG21.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG21.c
@@ -7,7 +7,8 @@ typedef struct {
 	FOO *b1;
 } BAR;
 
-Nase ()
+void
+Nase (void)
 {
 	int i, j;
 	FOO *foop;
diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG23.c b/gcc/testsuite/gcc.c-torture/compile/BUG23.c
index 1ff429ef0ac..2424286482c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG23.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG23.c
@@ -1,4 +1,5 @@
-main()
+int
+main(void)
 {
   static char static_char_array[1];
   static char *static_char_pointer;
diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG5.c b/gcc/testsuite/gcc.c-torture/compile/BUG5.c
index 9bed7136f59..390196b818d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG5.c
@@ -12,7 +12,7 @@ void bar()
   {
     case one:
     case two:
-      printf ("one to two\n");
+      __builtin_printf ("one to two\n");
     break;
   }
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/BUG6.c b/gcc/testsuite/gcc.c-torture/compile/BUG6.c
index b1394650964..4ec8ab2e3a8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/BUG6.c
+++ b/gcc/testsuite/gcc.c-torture/compile/BUG6.c
@@ -1,8 +1,9 @@
-main()
+int
+main(void)
 {
   unsigned long L;
   double D;
   D = L = -3;
-  printf("L=%lu, D=%g\n", L, D);
+  __builtin_printf("L=%lu, D=%g\n", L, D);
   return 0;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/b.c b/gcc/testsuite/gcc.c-torture/compile/b.c
index 498d7552af9..41242d012d3 100644
--- a/gcc/testsuite/gcc.c-torture/compile/b.c
+++ b/gcc/testsuite/gcc.c-torture/compile/b.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   *(short *) 25 = 123;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/b1.c b/gcc/testsuite/gcc.c-torture/compile/b1.c
index b6737594cb1..bab9500b7c2 100644
--- a/gcc/testsuite/gcc.c-torture/compile/b1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/b1.c
@@ -1,3 +1,4 @@
+int
 foo (long long x)
 {
   if (x--)
@@ -5,7 +6,8 @@ foo (long long x)
   return 0;
 }
 
-main ()
+int
+main (void)
 {
-  printf ("%d\n", foo (0));
+  __builtin_printf ("%d\n", foo (0));
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/b88.c b/gcc/testsuite/gcc.c-torture/compile/b88.c
index 971c7c76d92..9d92b20badb 100644
--- a/gcc/testsuite/gcc.c-torture/compile/b88.c
+++ b/gcc/testsuite/gcc.c-torture/compile/b88.c
@@ -1,3 +1,4 @@
+int
 foo (double d)
 {
   d = -d;
@@ -6,7 +7,8 @@ foo (double d)
   return 2;
 }
 
-main ()
+int
+main (void)
 {
   foo (0.0);
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/bbb.c b/gcc/testsuite/gcc.c-torture/compile/bbb.c
index 837dd9ecf93..419ef9235e5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/bbb.c
+++ b/gcc/testsuite/gcc.c-torture/compile/bbb.c
@@ -5,8 +5,8 @@ struct looksets
 
 struct looksets lkst[];
 
-flset( p )
-struct looksets *p;
+void
+flset( struct looksets *p )
 {
     p-- > lkst;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/bf.c b/gcc/testsuite/gcc.c-torture/compile/bf.c
index 821623df09c..365621452e7 100644
--- a/gcc/testsuite/gcc.c-torture/compile/bf.c
+++ b/gcc/testsuite/gcc.c-torture/compile/bf.c
@@ -1,5 +1,7 @@
 typedef unsigned long uint32;
 typedef signed long sint32;
+int clr (int, int, int);
+int atoi (const char *);
 
 uint32
 ext (sint32 src, unsigned o5, unsigned w5)
@@ -25,7 +27,8 @@ rot (uint32 src, unsigned o5)
   return (src >> o5) | (src << (( - o5) & 31));
 }
 
+int
 main (int argc, char **argv)
 {
-  printf ("%x\n", clr (0xffffffff, atoi (argv[2]), atoi (argv[1])));
+  __builtin_printf ("%x\n", clr (0xffffffff, atoi (argv[2]), atoi (argv[1])));
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/bt.c b/gcc/testsuite/gcc.c-torture/compile/bt.c
index ac20c05674d..ed86ad2db30 100644
--- a/gcc/testsuite/gcc.c-torture/compile/bt.c
+++ b/gcc/testsuite/gcc.c-torture/compile/bt.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int i;
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/charmtst.c b/gcc/testsuite/gcc.c-torture/compile/charmtst.c
index 2945f198e5e..897b4ccd882 100644
--- a/gcc/testsuite/gcc.c-torture/compile/charmtst.c
+++ b/gcc/testsuite/gcc.c-torture/compile/charmtst.c
@@ -1,3 +1,7 @@
+void foo (int);
+void bar (int, int);
+
+int
 c_move_tst (char b)
 {
   char a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c b/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c
index 9e1b659c7cf..f2e62988b36 100644
--- a/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c
@@ -1,3 +1,4 @@
+int
 f (long long d)
 {
   int i = 0;
@@ -6,6 +7,7 @@ f (long long d)
   return i;
 }
 
+int
 g (long long d)
 {
   int i = 0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/cmphi.c b/gcc/testsuite/gcc.c-torture/compile/cmphi.c
index 1ffc2140fba..ebc152b5e25 100644
--- a/gcc/testsuite/gcc.c-torture/compile/cmphi.c
+++ b/gcc/testsuite/gcc.c-torture/compile/cmphi.c
@@ -1,3 +1,4 @@
+int
 foo (short *p, short a)
 {
   return a < *p;
diff --git a/gcc/testsuite/gcc.c-torture/compile/conv.c b/gcc/testsuite/gcc.c-torture/compile/conv.c
index 70fc024127c..92712986409 100644
--- a/gcc/testsuite/gcc.c-torture/compile/conv.c
+++ b/gcc/testsuite/gcc.c-torture/compile/conv.c
@@ -22,11 +22,14 @@ d2i (double d)
   return d;
 }
 
-main ()
+int
+main (void)
 {
-  printf ("%lf, %lf, %lf\n", u2d (~0), u2d (1 << 31), u2d (1));
-  printf ("%lf, %lf, %lf\n", i2d (~0), i2d (1 << 31), i2d (1));
+  __builtin_printf ("%lf, %lf, %lf\n", u2d (~0), u2d (1 << 31), u2d (1));
+  __builtin_printf ("%lf, %lf, %lf\n", i2d (~0), i2d (1 << 31), i2d (1));
 
-  printf ("%u, %u, %u\n", d2u (u2d (~0)), d2u (u2d (1 << 31)), d2u (u2d (1)));
-  printf ("%d, %d, %d\n", d2i (i2d (~0)), d2i (i2d (1 << 31)), d2i (i2d (1)));
+  __builtin_printf ("%u, %u, %u\n",
+		    d2u (u2d (~0)), d2u (u2d (1 << 31)), d2u (u2d (1)));
+  __builtin_printf ("%d, %d, %d\n",
+		    d2i (i2d (~0)), d2i (i2d (1 << 31)), d2i (i2d (1)));
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/ddd.c b/gcc/testsuite/gcc.c-torture/compile/ddd.c
index b0b6809dd69..481776f63e1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/ddd.c
+++ b/gcc/testsuite/gcc.c-torture/compile/ddd.c
@@ -1,7 +1,8 @@
 int foo;
 int bar;
 
-main ()
+int
+main (void)
 {
   return foo + bar;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/dilayout.c b/gcc/testsuite/gcc.c-torture/compile/dilayout.c
index 4bba661c0a4..595d78dff59 100644
--- a/gcc/testsuite/gcc.c-torture/compile/dilayout.c
+++ b/gcc/testsuite/gcc.c-torture/compile/dilayout.c
@@ -21,11 +21,13 @@ foo (int *p, struct foo a)
   return a.ab;
 }
 
+void
 str (struct ii ab, struct ii *p)
 {
   *p = ab;
 }
 
+void
 ll (long long ab, long long *p)
 {
   *p = ab;
diff --git a/gcc/testsuite/gcc.c-torture/compile/dimove.c b/gcc/testsuite/gcc.c-torture/compile/dimove.c
index 7caf3fa468b..bda08385838 100644
--- a/gcc/testsuite/gcc.c-torture/compile/dimove.c
+++ b/gcc/testsuite/gcc.c-torture/compile/dimove.c
@@ -1,3 +1,4 @@
+void
 foo (long long *p)
 {
   p[0] = p[1];
diff --git a/gcc/testsuite/gcc.c-torture/compile/f2.c b/gcc/testsuite/gcc.c-torture/compile/f2.c
index 8bb384902b9..de067fa502e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/f2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/f2.c
@@ -1,3 +1,4 @@
+void
 foo (double *p)
 {
   p[0] = p[1];
diff --git a/gcc/testsuite/gcc.c-torture/compile/flatten.c b/gcc/testsuite/gcc.c-torture/compile/flatten.c
index 73042bed64a..9d1d21facb4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/flatten.c
+++ b/gcc/testsuite/gcc.c-torture/compile/flatten.c
@@ -1,5 +1,6 @@
 int you_shall_not_flatten_me () __attribute__ ((flatten));
-main()
+int
+main(void)
 {
   you_shall_not_flatten_me ();
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/fnul.c b/gcc/testsuite/gcc.c-torture/compile/fnul.c
index b0c9816adf7..8a9a401757d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/fnul.c
+++ b/gcc/testsuite/gcc.c-torture/compile/fnul.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int i;
   int f;
@@ -9,15 +10,15 @@ main ()
 
       if ((i & (i - 1)) == 0)
 	{
-	  printf ("d");
+	  __builtin_printf ("d");
 	  f = 1;
 	}
       if ((i & -i) == i)
 	{
-	  printf ("t");
+	  __builtin_printf ("t");
 	  f = 1;
 	}
       if (f)
-	printf ("%d\n", i);
+	__builtin_printf ("%d\n", i);
     }
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/fq.c b/gcc/testsuite/gcc.c-torture/compile/fq.c
index c4ac3696096..ca8b3339a43 100644
--- a/gcc/testsuite/gcc.c-torture/compile/fq.c
+++ b/gcc/testsuite/gcc.c-torture/compile/fq.c
@@ -1,3 +1,4 @@
+void
 expand_to_ascii (int *i, int *o)
 {
   unsigned x, y, out;
diff --git a/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c b/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c
index 79687c9c005..d1f3f525a7c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c
@@ -3,17 +3,18 @@ extern int (*gp)(const char*);
 int
 g (const char* d)
 {
-  printf ("g");
+  __builtin_printf ("g");
   return 0;
 }
 
-f ()
+void
+f (void)
 {
   int errcnt=0;
 
   if (gp != g)
     {
-      printf ("f");
+      __builtin_printf ("f");
       errcnt++;
     }
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/glob.c b/gcc/testsuite/gcc.c-torture/compile/glob.c
index e3206154fd9..c4efc8c657b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/glob.c
+++ b/gcc/testsuite/gcc.c-torture/compile/glob.c
@@ -4,7 +4,8 @@ tt a1;
 tt a2;
 tt a3;
 
-foo ()
+void
+foo (void)
 {
   a1++;
   a2++;
diff --git a/gcc/testsuite/gcc.c-torture/compile/goto-1.c b/gcc/testsuite/gcc.c-torture/compile/goto-1.c
index caeed3aa0ba..336ff2e6ce9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/goto-1.c
@@ -1,4 +1,5 @@
-f ()
+void
+f (void)
 {
   do
     {
diff --git a/gcc/testsuite/gcc.c-torture/compile/i++.c b/gcc/testsuite/gcc.c-torture/compile/i++.c
index 01d9ca95a8a..fd6a38c395c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/i++.c
+++ b/gcc/testsuite/gcc.c-torture/compile/i++.c
@@ -3,5 +3,5 @@ int main ()
   int i = 2;
 
   i = i++;
-  printf ("%d\n",i);
+  __builtin_printf ("%d\n",i);
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/ic.c b/gcc/testsuite/gcc.c-torture/compile/ic.c
index 150e1e8ed7e..05ae9722a73 100644
--- a/gcc/testsuite/gcc.c-torture/compile/ic.c
+++ b/gcc/testsuite/gcc.c-torture/compile/ic.c
@@ -1,3 +1,4 @@
+int
 foo (int *ip, int a)
 {
   a++;
diff --git a/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c b/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c
index a0adc78cf82..77aac0444f4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c
@@ -1,5 +1,8 @@
 /* Verify that ifcvt doesn't crash under a number of interesting conditions. */
 
+void bar (void);
+void baz (void);
+
 void f1(int p)
 {
   if (p)
@@ -39,13 +42,13 @@ void f5(int p)
   if (p)
     __builtin_trap();
   else
-    abort();
+    __builtin_abort();
 }
 
 void f6(int p)
 {
   if (p)
-    abort();
+    __builtin_abort();
   else
     __builtin_trap();
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c b/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c
index bb7bb5726b1..e03ea74fe8b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c
@@ -1,3 +1,5 @@
+void bar (void);
+
 void foo(int p, int q)
 {
   if (p)
diff --git a/gcc/testsuite/gcc.c-torture/compile/jmp.c b/gcc/testsuite/gcc.c-torture/compile/jmp.c
index 474206a1f5e..814b49ea902 100644
--- a/gcc/testsuite/gcc.c-torture/compile/jmp.c
+++ b/gcc/testsuite/gcc.c-torture/compile/jmp.c
@@ -1,4 +1,5 @@
-foo (a)
+int
+foo (int a)
 {
   if (a)
     goto a1;
diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-1.c b/gcc/testsuite/gcc.c-torture/compile/labels-1.c
index 7889567ffa6..80b46b060b5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/labels-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/labels-1.c
@@ -1,11 +1,12 @@
 /* { dg-require-effective-target label_values } */
 
-f ()
+int
+f (void)
 {
   void *x = &&L2;
   if (&&L3 - &&L1 > 1)
-    abort();
+    __builtin_abort();
  L1: return 1;
- L2: abort ();
+ L2: __builtin_abort ();
  L3:;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-2.c b/gcc/testsuite/gcc.c-torture/compile/labels-2.c
index 316a380b3ce..977fc163001 100644
--- a/gcc/testsuite/gcc.c-torture/compile/labels-2.c
+++ b/gcc/testsuite/gcc.c-torture/compile/labels-2.c
@@ -1,12 +1,12 @@
 /* { dg-require-effective-target label_values } */
 
 struct bp { void *v, *b, *e; };
-f ()
+int f (void)
 {
   struct bp x = { &&L2 };
   if (&&L3 - &&L1 > 1)
-    abort ();
+    __builtin_abort ();
 L1:return 1;
-L2:abort ();
+L2:__builtin_abort ();
 L3:;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/lbug.c b/gcc/testsuite/gcc.c-torture/compile/lbug.c
index 0440a0a7a9d..2db708c8733 100644
--- a/gcc/testsuite/gcc.c-torture/compile/lbug.c
+++ b/gcc/testsuite/gcc.c-torture/compile/lbug.c
@@ -1,5 +1,6 @@
 long long x = 0;
-main()
+int
+main(void)
 {
   if (x--)
     return 255;
diff --git a/gcc/testsuite/gcc.c-torture/compile/memtst.c b/gcc/testsuite/gcc.c-torture/compile/memtst.c
index 44cdaf8e83a..a8b054a84d8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/memtst.c
+++ b/gcc/testsuite/gcc.c-torture/compile/memtst.c
@@ -6,6 +6,7 @@
 #define SIZE 65536
 #endif
 
+void
 memtst (int *p, int a)
 {
   do
@@ -16,11 +17,12 @@ memtst (int *p, int a)
   while (--a);
 }
 
-main ()
+int
+main (void)
 {
   int a[SIZE];
   int i;
-  bzero (a, SIZE * 4);
+  __builtin_bzero (a, SIZE * 4);
   for (i = 0;  i < 100;  i++)
     {
       memtst (a, SIZE);
diff --git a/gcc/testsuite/gcc.c-torture/compile/miscomp.c b/gcc/testsuite/gcc.c-torture/compile/miscomp.c
index 0bcb568d54b..f71173876fd 100644
--- a/gcc/testsuite/gcc.c-torture/compile/miscomp.c
+++ b/gcc/testsuite/gcc.c-torture/compile/miscomp.c
@@ -1,12 +1,13 @@
 unsigned char foo(unsigned long);
-main()
+int
+main(void)
 {
     unsigned char AChar;
     unsigned long ALong = 0x12345678;
 
     AChar = foo(ALong);
 
-    printf("AChar = %x\n",(int)AChar);
+    __builtin_printf("AChar = %x\n",(int)AChar);
 }
 unsigned char
 foo( unsigned long TheLong)
diff --git a/gcc/testsuite/gcc.c-torture/compile/msp.c b/gcc/testsuite/gcc.c-torture/compile/msp.c
index 263a873e264..6eeb9bcce21 100644
--- a/gcc/testsuite/gcc.c-torture/compile/msp.c
+++ b/gcc/testsuite/gcc.c-torture/compile/msp.c
@@ -1,11 +1,14 @@
 /* { dg-add-options stack_size } */
 
+void bar (int *);
+
 #ifdef STACK_SIZE
 # define A_SIZE (STACK_SIZE/sizeof(int))
 #else
 # define A_SIZE 16384
 #endif
-foo ()
+void
+foo (void)
 {
   int a[A_SIZE];
   bar (a);
diff --git a/gcc/testsuite/gcc.c-torture/compile/mtst.c b/gcc/testsuite/gcc.c-torture/compile/mtst.c
index 4f43137b705..f11f5f9cbb5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/mtst.c
+++ b/gcc/testsuite/gcc.c-torture/compile/mtst.c
@@ -1,3 +1,4 @@
+int
 foo (int *p, int c)
 {
   int a, b;
diff --git a/gcc/testsuite/gcc.c-torture/compile/packed-1.c b/gcc/testsuite/gcc.c-torture/compile/packed-1.c
index 709fc3cb102..aa9cab49786 100644
--- a/gcc/testsuite/gcc.c-torture/compile/packed-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/packed-1.c
@@ -8,7 +8,8 @@ struct rbuf
   struct s *p __attribute__ ((packed));
 } *b;
 
-f ()
+void
+f (void)
 {
   b->p = &x;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr17119.c b/gcc/testsuite/gcc.c-torture/compile/pr17119.c
index 28d6ccbe0b2..eb955190fb9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr17119.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr17119.c
@@ -1,3 +1,6 @@
+void func1 (void);
+void func2 (void);
+
 void
 _mesa_DrawPixels (int width, int height, unsigned format,
 		  unsigned type, const void * pixels)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr18712.c b/gcc/testsuite/gcc.c-torture/compile/pr18712.c
index 7d53aaae877..7f00e856873 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr18712.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr18712.c
@@ -1,3 +1,5 @@
+void foo (void);
+void foo1 (int *);
 void *eintr_source (void *arg)
 {
   int ts = 0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr20412.c b/gcc/testsuite/gcc.c-torture/compile/pr20412.c
index a165a921ac2..25e723062be 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr20412.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr20412.c
@@ -1,3 +1,7 @@
+int bar1(void);
+int bar2(void);
+int bar3(void);
+
 int
 foo(void)
 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr21532.c b/gcc/testsuite/gcc.c-torture/compile/pr21532.c
index 1b8bc224849..0ffe083466f 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr21532.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr21532.c
@@ -1,4 +1,4 @@
-
+int foo (int);
 
 int
 bar (unsigned char key)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr22398.c b/gcc/testsuite/gcc.c-torture/compile/pr22398.c
index 448de5712cd..193727ac8d4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr22398.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr22398.c
@@ -1,5 +1,5 @@
 #if ULONG_MAX != 4294967295u && ULONG_MAX != 18446744073709551615ull
-int main(void) { exit (0); }
+int main(void) { __builtin_exit (0); }
 #else
 #if ULONG_MAX != 18446744073709551615ull
 #define NUM 0xf0000000
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr24883.c b/gcc/testsuite/gcc.c-torture/compile/pr24883.c
index b2ced75ac96..df6500132b9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr24883.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr24883.c
@@ -2,6 +2,7 @@ typedef struct _rec_stl rec_stl;
 struct _rec_stl {
    unsigned char **strs;
 };
+void
 orec_str_list(int count) {
    rec_stl *stl;
    int i, j;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr25311.c b/gcc/testsuite/gcc.c-torture/compile/pr25311.c
index 43ef3fd9523..a9fafb4a9ed 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr25311.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr25311.c
@@ -13,6 +13,8 @@ struct w
 
 extern struct w *Qnil;
 
+void use (struct w *);
+
 void
 set_size (struct w *w, int new_size, int nodelete, int set_height)
 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr25514.c b/gcc/testsuite/gcc.c-torture/compile/pr25514.c
index 0bf5aa9077d..81475921c4c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr25514.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr25514.c
@@ -5,6 +5,8 @@ struct node {
 
 struct node *current_node, global_list;
 
+void foo (struct node *);
+
 void
 bar (void)
 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr26425.c b/gcc/testsuite/gcc.c-torture/compile/pr26425.c
index 8931b401426..c7e74bb11f5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr26425.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr26425.c
@@ -1,6 +1,7 @@
 struct keyring_list {
  struct key *keys[0];
 };
+void key_put(struct key *);
 void keyring_destroy(struct keyring_list *keyring, unsigned short a)
 {
  int loop;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27087.c b/gcc/testsuite/gcc.c-torture/compile/pr27087.c
index 3add13bcbeb..b8cbd7ed7d4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr27087.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr27087.c
@@ -1,5 +1,6 @@
 extern int ptbl[4];
 extern int ctbl[4];
+void g(void);
 
 void doViews(void) {
     int  *c = ctbl, *p = ptbl;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27282.c b/gcc/testsuite/gcc.c-torture/compile/pr27282.c
index ab663665064..b36e03a744a 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr27282.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr27282.c
@@ -9,6 +9,7 @@ struct _ColRowInfo
   unsigned margin_b:3;
   unsigned visible:1;
 };
+int
 colrow_equal (ColRowInfo const *a, ColRowInfo const *b)
 {
   return a->size_pts == b->size_pts && a->margin_a == b->margin_a
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr27907.c b/gcc/testsuite/gcc.c-torture/compile/pr27907.c
index 575ac6a774c..7248dfb146c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr27907.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr27907.c
@@ -13,6 +13,7 @@ struct fann
 {
     struct fann_layer *first_layer;
 };
+void
 fann_run (struct fann *ann, fann_type * input)
 {
   struct fann_layer *layer_it, *layer_it2, *last_layer;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr28489.c b/gcc/testsuite/gcc.c-torture/compile/pr28489.c
index 60d23b18faa..55a3b98ddc1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr28489.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr28489.c
@@ -12,6 +12,7 @@ static union c_insn c_stack[((0x100 + 4) * 4)];
 static struct c_ident *c_funcs;
 static void (*c_op_bz) ();
 static void c_direct (union c_insn *addr);
+void
 c_compile (int (*ext_getchar) (), void (*ext_rewind) (),
 	   struct c_ident *externs)
 {
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr28776-1.c b/gcc/testsuite/gcc.c-torture/compile/pr28776-1.c
index a37fb6fe105..c55bd483a30 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr28776-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr28776-1.c
@@ -4,6 +4,7 @@ typedef struct dw_fde_struct
 } *dw_fde_ref;
 dw_fde_ref fde_table;
 unsigned fde_table_in_use;
+void tree_contains_struct_check_failed (int);
 void output_call_frame_info (void)
 {
   unsigned int i;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr29128.c b/gcc/testsuite/gcc.c-torture/compile/pr29128.c
index 3358b470198..c720395f907 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr29128.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr29128.c
@@ -2,6 +2,7 @@
 /* { dg-require-effective-target label_values } */
 
 typedef unsigned long Eterm;
+void
 process_main (void)
 {
   register Eterm x0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr29945.c b/gcc/testsuite/gcc.c-torture/compile/pr29945.c
index 775af29ef07..d7397c244f2 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr29945.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr29945.c
@@ -1,6 +1,8 @@
 /* This test used to ICE on the SPU target. */
 extern const char *__ctype_ptr;
+void unget_char (int);
 
+void
 parse_real (unsigned char c)
 {
   if ((__ctype_ptr[c]&04) && c != '.')
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr33382.c b/gcc/testsuite/gcc.c-torture/compile/pr33382.c
index c939cf7b772..3a24caae496 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr33382.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr33382.c
@@ -35,12 +35,12 @@ void show_configuration(char *arg)
 				       ? (__builtin_constant_p(arg)
 					  && ((size_t) (const void *) 1) ?
 					  : (__extension__( {
-							   __const * __s2 =
-							   (__const *)
+							   __const int * __s2 =
+							   (__const int *)
 							   (arg);
-							   register
+							   register int
 							   __result =
-							   (((__const
+							   (((__const int
 							      *) (arglist
 								  [i].
 								  lng))[0]
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36141.c b/gcc/testsuite/gcc.c-torture/compile/pr36141.c
index 82756199b77..4fb22b29072 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr36141.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr36141.c
@@ -1,4 +1,5 @@
 extern void ffi_closure_unix (void);
+void
 ffi_prep_closure_loc (void)
 {
   struct ia64_fd
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr36988.c b/gcc/testsuite/gcc.c-torture/compile/pr36988.c
index 44118d5dda3..30e86eae9b3 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr36988.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr36988.c
@@ -1,6 +1,7 @@
 typedef struct {
     unsigned char mbxCommand;
 } MAILBOX_t;
+void __writel(unsigned int);
 void lpfc_sli_brdrestart(void)
 {
   volatile unsigned int word0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37026.c b/gcc/testsuite/gcc.c-torture/compile/pr37026.c
index 694e2ca2a5f..f59b119f4dc 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37026.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37026.c
@@ -6,6 +6,7 @@ struct b {
     struct a b1;
     struct a b2;
 };
+int foo (void);
 void bar (struct b *c)
 {
   c->b1 = c->b2 = ((struct a) { foo(), 0 });
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr37285.c b/gcc/testsuite/gcc.c-torture/compile/pr37285.c
index 972478b1879..ce1a02990f4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr37285.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr37285.c
@@ -1,3 +1,5 @@
+void _bfd_abort (const char *);
+void
 _bfd_xcoff_canonicalize_dynamic_reloc (unsigned long long l_symndx)
 {
   if (l_symndx < 3)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr38554.c b/gcc/testsuite/gcc.c-torture/compile/pr38554.c
index 7d40a223be0..b0f9207b3f3 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr38554.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr38554.c
@@ -19,6 +19,7 @@ struct cmdlineInfo
   }
     u;
 };
+void
 applyFunction (struct cmdlineInfo const cmdline, struct pam const inpam,
                struct pam const outpam, tuple * const inputRow,
                tuple * const outputRow)
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr42164.c b/gcc/testsuite/gcc.c-torture/compile/pr42164.c
index 7b94aefe7d8..343d7e7aa96 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr42164.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr42164.c
@@ -16,6 +16,8 @@ typedef struct
 {
   unsigned long val;
 } swp_entry_t;
+unsigned long swp_offset(swp_entry_t);
+void __BUG_ON(unsigned long);
 pte_t swp_entry_to_pte (swp_entry_t entry)
 {
   swp_entry_t arch_entry;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr44788.c b/gcc/testsuite/gcc.c-torture/compile/pr44788.c
index b570f65ff92..9811046eaa1 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr44788.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr44788.c
@@ -1,5 +1,7 @@
 /* { dg-require-stack-size "1060*4+4" } */
 
+void foo(float *);
+
 void joint_decode(float* mlt_buffer1, int t) {
     int i;
     float decode_buffer[1060];
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr47364-1.c b/gcc/testsuite/gcc.c-torture/compile/pr47364-1.c
index 0a4e82d8564..b23714d6ada 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr47364-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr47364-1.c
@@ -1,5 +1,6 @@
 static unsigned char foo[256];
 
+void
 arc4_init(void)
 {
   int n;
diff --git a/gcc/testsuite/gcc.c-torture/compile/pr48596.c b/gcc/testsuite/gcc.c-torture/compile/pr48596.c
index 743bd82e868..194a023e0b9 100644
--- a/gcc/testsuite/gcc.c-torture/compile/pr48596.c
+++ b/gcc/testsuite/gcc.c-torture/compile/pr48596.c
@@ -6,6 +6,7 @@ typedef struct { int size; int center; }  NrrdAxis;
 typedef struct { int dim; NrrdAxis axis[10]; } Nrrd;
 typedef struct { } NrrdKernel;
 typedef struct { const NrrdKernel *kernel[10]; int samples[10]; } Info;
+int _nrrdCenter(int);
 
 void
 foo (Nrrd *nout, Nrrd *nin, const NrrdKernel *kernel, const double *parm,
diff --git a/gcc/testsuite/gcc.c-torture/compile/rel.c b/gcc/testsuite/gcc.c-torture/compile/rel.c
index 54d36052ed3..8774164cd73 100644
--- a/gcc/testsuite/gcc.c-torture/compile/rel.c
+++ b/gcc/testsuite/gcc.c-torture/compile/rel.c
@@ -1,3 +1,4 @@
+int
 foo (int *c, int b)
 {
   int a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/run.c b/gcc/testsuite/gcc.c-torture/compile/run.c
index 40892f6037f..8375b782c86 100644
--- a/gcc/testsuite/gcc.c-torture/compile/run.c
+++ b/gcc/testsuite/gcc.c-torture/compile/run.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   typedef short int xtype;
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/sar.c b/gcc/testsuite/gcc.c-torture/compile/sar.c
index 9bf9bec0625..34e8cdf0b25 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sar.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sar.c
@@ -3,7 +3,8 @@ struct foo
   char a;
 } foo[100];
 
-main ()
+int
+main (void)
 {
   foo[1].a = '1';
   foo[2].a = '2';
diff --git a/gcc/testsuite/gcc.c-torture/compile/selfrec.c b/gcc/testsuite/gcc.c-torture/compile/selfrec.c
index c7aaca552a0..c79f1c09233 100644
--- a/gcc/testsuite/gcc.c-torture/compile/selfrec.c
+++ b/gcc/testsuite/gcc.c-torture/compile/selfrec.c
@@ -1,5 +1,5 @@
 int
-foo (a)
+foo (int a)
 {
   return foo (a - 1) * a;
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/shloop.c b/gcc/testsuite/gcc.c-torture/compile/shloop.c
index f4c9366394a..7bb85466653 100644
--- a/gcc/testsuite/gcc.c-torture/compile/shloop.c
+++ b/gcc/testsuite/gcc.c-torture/compile/shloop.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int volatile p;
   int i;
diff --git a/gcc/testsuite/gcc.c-torture/compile/shm.c b/gcc/testsuite/gcc.c-torture/compile/shm.c
index b667b26abe9..acd12fd9077 100644
--- a/gcc/testsuite/gcc.c-torture/compile/shm.c
+++ b/gcc/testsuite/gcc.c-torture/compile/shm.c
@@ -1,3 +1,4 @@
+int
 foo (int *p)
 {
   int a = *p;
diff --git a/gcc/testsuite/gcc.c-torture/compile/sim.c b/gcc/testsuite/gcc.c-torture/compile/sim.c
index e8c4fb42f53..93d13f87da6 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sim.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sim.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int i;
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.c b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
index 2d0be4fc78d..784d1fd86e0 100644
--- a/gcc/testsuite/gcc.c-torture/compile/simd-5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
@@ -1,6 +1,6 @@
 #define vector64 __attribute__((vector_size(8)))
 
-main(){
+int main(void){
 
  vector64 int  c;
 vector64 int a = {1, -1};
@@ -8,5 +8,5 @@ vector64 int b = {2, -2};
 c = -a + b*b*(-1LL);
 /* c is now {-5, -3} */
 
- printf("result is %llx\n", (long long)c); 
+ __builtin_printf("result is %llx\n", (long long)c); 
 }
diff --git a/gcc/testsuite/gcc.c-torture/compile/sne.c b/gcc/testsuite/gcc.c-torture/compile/sne.c
index 6844a6e53b9..b0f3e1c7314 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sne.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sne.c
@@ -1,3 +1,4 @@
+int
 foo (double a)
 {
   return (a != 0);
diff --git a/gcc/testsuite/gcc.c-torture/compile/sound.c b/gcc/testsuite/gcc.c-torture/compile/sound.c
index 66e24a00f68..899b87d3d33 100644
--- a/gcc/testsuite/gcc.c-torture/compile/sound.c
+++ b/gcc/testsuite/gcc.c-torture/compile/sound.c
@@ -1,6 +1,9 @@
 /* { dg-require-stack-size "8192+4" } */
 
-main ()
+int write (int, void *, __SIZE_TYPE__);
+
+int
+main (void)
 {
   char audio[8192];
   int i;
diff --git a/gcc/testsuite/gcc.c-torture/compile/speed.c b/gcc/testsuite/gcc.c-torture/compile/speed.c
index d61407e321d..2bdb8bffe8c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/speed.c
+++ b/gcc/testsuite/gcc.c-torture/compile/speed.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int i;
 
diff --git a/gcc/testsuite/gcc.c-torture/compile/store0.c b/gcc/testsuite/gcc.c-torture/compile/store0.c
index 3b7b16ef3bc..8c9c3b43740 100644
--- a/gcc/testsuite/gcc.c-torture/compile/store0.c
+++ b/gcc/testsuite/gcc.c-torture/compile/store0.c
@@ -1,3 +1,4 @@
+void
 foo (int *p)
 {
   p[10] = 0;
diff --git a/gcc/testsuite/gcc.c-torture/compile/storecc.c b/gcc/testsuite/gcc.c-torture/compile/storecc.c
index 11634691091..d2f4c9c229d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/storecc.c
+++ b/gcc/testsuite/gcc.c-torture/compile/storecc.c
@@ -1,3 +1,4 @@
+int
 foo (char *p, int a)
 {
   *p = a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/strcpy-1.c b/gcc/testsuite/gcc.c-torture/compile/strcpy-1.c
index 2c7b16a08d8..992f3a1f9fe 100644
--- a/gcc/testsuite/gcc.c-torture/compile/strcpy-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/strcpy-1.c
@@ -6,7 +6,8 @@ typedef struct
 }STACK;
 STACK stack[15];
 int level;
-rezero ()
+void
+rezero (void)
 {
   level = 0;
   __builtin_strcpy (stack[level].str, "");
diff --git a/gcc/testsuite/gcc.c-torture/compile/stru.c b/gcc/testsuite/gcc.c-torture/compile/stru.c
index 042c5221784..1f76585ef0e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/stru.c
+++ b/gcc/testsuite/gcc.c-torture/compile/stru.c
@@ -3,6 +3,7 @@ struct foo
   int a, b, c;
 };
 
+void
 foo (struct foo *a)
 {
   a[0] = a[1];
diff --git a/gcc/testsuite/gcc.c-torture/compile/stuct.c b/gcc/testsuite/gcc.c-torture/compile/stuct.c
index b70957e9891..3306188e1f5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/stuct.c
+++ b/gcc/testsuite/gcc.c-torture/compile/stuct.c
@@ -14,7 +14,8 @@ struct foo
 
 struct foo s, ss;
 
-main ()
+int
+main (void)
 {
 
   s.b = 2;
diff --git a/gcc/testsuite/gcc.c-torture/compile/time.c b/gcc/testsuite/gcc.c-torture/compile/time.c
index 7e22681d98b..c7feb0d294c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/time.c
+++ b/gcc/testsuite/gcc.c-torture/compile/time.c
@@ -1,4 +1,5 @@
-main ()
+int
+main (void)
 {
   int i;
   for (i = 3000000; --i;)
diff --git a/gcc/testsuite/gcc.c-torture/compile/unalign-1.c b/gcc/testsuite/gcc.c-torture/compile/unalign-1.c
index 350111fdff4..e827b1e03d8 100644
--- a/gcc/testsuite/gcc.c-torture/compile/unalign-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/unalign-1.c
@@ -7,6 +7,7 @@ typedef struct __attribute__ ((__packed__))
     char stepsRemoved;
     ptp_tlv_t tlv[1];
 } ptp_message_announce_t;
+void f(ptp_message_announce_t *);
 int ptplib_send_announce(int sequenceId, int i)
 {
     ptp_message_announce_t tx_packet;
diff --git a/gcc/testsuite/gcc.c-torture/compile/v.c b/gcc/testsuite/gcc.c-torture/compile/v.c
index 87ac00aef64..24d47a418ce 100644
--- a/gcc/testsuite/gcc.c-torture/compile/v.c
+++ b/gcc/testsuite/gcc.c-torture/compile/v.c
@@ -1,3 +1,4 @@
+int
 main (int *p)
 {
   int a;
diff --git a/gcc/testsuite/gcc.c-torture/compile/xcsebug.c b/gcc/testsuite/gcc.c-torture/compile/xcsebug.c
index 614a6e80ebf..43a30cce43b 100644
--- a/gcc/testsuite/gcc.c-torture/compile/xcsebug.c
+++ b/gcc/testsuite/gcc.c-torture/compile/xcsebug.c
@@ -1,7 +1,8 @@
 int g1;
 int g2;
 
-foo ()
+void
+foo (void)
 {
   int i = 1;
   int x;
diff --git a/gcc/testsuite/gcc.c-torture/compile/xmtst.c b/gcc/testsuite/gcc.c-torture/compile/xmtst.c
index ca78fcaac12..4e8689057ba 100644
--- a/gcc/testsuite/gcc.c-torture/compile/xmtst.c
+++ b/gcc/testsuite/gcc.c-torture/compile/xmtst.c
@@ -1,13 +1,16 @@
+int
 p1 (int b, int *p, int a)
 {
   p[0] = p[1];
   return p[0];
 }
+int
 p2 (int b, int *p, int a)
 {
   p[0] = p[1];
   return p[0] == 0;
 }
+int
 p3 (int b, int *p, int a)
 {
   p[0] = p[1];
@@ -16,6 +19,7 @@ p3 (int b, int *p, int a)
     return 0;
   return a;
 }
+int
 p4 (int b, int *p, int a)
 {
   a = p[1];
diff --git a/gcc/testsuite/gcc.c-torture/compile/xz.c b/gcc/testsuite/gcc.c-torture/compile/xz.c
index 97a1d1e2cdc..109d1677c7d 100644
--- a/gcc/testsuite/gcc.c-torture/compile/xz.c
+++ b/gcc/testsuite/gcc.c-torture/compile/xz.c
@@ -1,3 +1,4 @@
+void
 foo (int *p)
 {
   *p = (unsigned short) *p;
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
index a857f270c30..4d053037bc7 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2f.c
@@ -26,6 +26,7 @@
 
 #define OFFSET (MAP_LEN/2 - 2 * sizeof (char));
 
+void
 f (int s, char *p)
 {
   int i;
@@ -35,7 +36,8 @@ f (int s, char *p)
     }
 }
 
-main ()
+int
+main (void)
 {
 #ifdef MAP_ANON
   char *p;
@@ -44,7 +46,7 @@ main ()
   dev_zero = open ("/dev/zero", O_RDONLY);
   /* -1 is OK when we have MAP_ANON; else mmap will flag an error.  */
   if (INT_MAX != 0x7fffffffL || sizeof (char *) != sizeof (int))
-    exit (0);
+    return 0;
   p = mmap (MAP_START, MAP_LEN, PROT_READ|PROT_WRITE,
 	    MAP_ANON|MAP_FIXED|MAP_PRIVATE, dev_zero, 0);
   if (p != (char *)-1)
@@ -53,12 +55,12 @@ main ()
       p[39] = 0;
       f (0, p);
       if (p[39] != (char)-2)
-	abort ();
+	__builtin_abort ();
       p[39] = 0;
       f (-1, p);
       if (p[39] != 0)
-	abort ();
+	__builtin_abort ();
     }
 #endif
-  exit (0);
+  return 0;
 }
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
index 71e24096cd4..f6401f4880a 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2g.c
@@ -26,6 +26,7 @@
 
 #define OFFSET (MAP_LEN/2 - 2 * sizeof (char));
 
+void
 f (int s, char *p)
 {
   int i;
@@ -35,7 +36,8 @@ f (int s, char *p)
     }
 }
 
-main ()
+int
+main (void)
 {
 #ifdef MAP_ANON
   char *p;
@@ -44,7 +46,7 @@ main ()
   dev_zero = open ("/dev/zero", O_RDONLY);
   /* -1 is OK when we have MAP_ANON; else mmap will flag an error.  */
   if (INT_MAX != 0x7fffffffL || sizeof (char *) != sizeof (int))
-    exit (0);
+    return 0;
   p = mmap (MAP_START, MAP_LEN, PROT_READ|PROT_WRITE,
 	    MAP_ANON|MAP_FIXED|MAP_PRIVATE, dev_zero, 0);
   if (p != (char *)-1)
@@ -53,12 +55,12 @@ main ()
       p[39] = 0;
       f (0, p);
       if (p[39] != (char)-2)
-	abort ();
+	__builtin_abort ();
       p[39] = 0;
       f (-1, p);
       if (p[39] != 0)
-	abort ();
+	__builtin_abort ();
     }
 #endif
-  exit (0);
+  return 0;
 }
diff --git a/gcc/testsuite/gcc.dg/20020206-1.c b/gcc/testsuite/gcc.dg/20020206-1.c
index 4b3d0fc767a..c8d8b61937a 100644
--- a/gcc/testsuite/gcc.dg/20020206-1.c
+++ b/gcc/testsuite/gcc.dg/20020206-1.c
@@ -3,8 +3,8 @@
    for -O2 -fprefetch-loop-arrays for ix86 targets.  */
 
 /* { dg-do run } */
-/* { dg-options "-O2 -fprefetch-loop-arrays -w" } */
-/* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3 -w" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-options "-O2 -fprefetch-loop-arrays" } */
+/* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
 
 
 struct reload
@@ -40,6 +40,6 @@ main ()
   n_reloads = 4;
   rld[2].out = 2;
   if (combine_reloads () != 2)
-    abort ();
-  exit (0);
+    __builtin_abort ();
+  __builtin_exit (0);
 }
diff --git a/gcc/testsuite/gcc.dg/ipa/20040703-wpa.c b/gcc/testsuite/gcc.dg/ipa/20040703-wpa.c
index b1a318be886..963134cc3db 100644
--- a/gcc/testsuite/gcc.dg/ipa/20040703-wpa.c
+++ b/gcc/testsuite/gcc.dg/ipa/20040703-wpa.c
@@ -139,13 +139,13 @@ int main()
    cpp_num res = num_lshift (num, 64, n);
 
    if (res.low != 0x30000)
-     abort ();
+     __builtin_abort ();
 
    if (res.high != 0)
-     abort ();
+     __builtin_abort ();
 
    if (res.overflow != 0)
-     abort ();
+     __builtin_abort ();
 
-   exit (0);
+   __builtin_exit (0);
 }
diff --git a/gcc/testsuite/gcc.dg/torture/pr84528.c b/gcc/testsuite/gcc.dg/torture/pr84528.c
index b56a1c47176..87be6fd3397 100644
--- a/gcc/testsuite/gcc.dg/torture/pr84528.c
+++ b/gcc/testsuite/gcc.dg/torture/pr84528.c
@@ -3,14 +3,15 @@
 
 #define SIZE 8
 
-main()
+int
+main(void)
 {
   int a[SIZE] = {1};
   int i;
 
   for (i = 1; i < SIZE; i++)
     if (a[i] != 0)
-      abort();
+      __builtin_abort();
 
-  exit (0);
+  __builtin_exit (0);
 }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-2.c
index cca706e0c4f..827b61fe67b 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-2.c
@@ -34,6 +34,8 @@ union tree_node
   int mode;
   struct tree_type type;
 };
+int vector_type_mode (tree);
+void real_inf (struct real_value *);
 tree
 omp_reduction_init (tree clause, tree type)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-3.c
index 354872595fb..7209615f322 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-3.c
@@ -11,13 +11,15 @@ struct entry
   unsigned short len;
   const char *attrib;
 };
+hashval_t iterative_hash (const struct entry *, __SIZE_TYPE__, hashval_t);
+hashval_t
 e_hash (const void *a)
 {
   const struct entry *e = a;
   hashval_t ret = 0;
   int i;
   if (e[0].etype != ETYPE_STRUCT && e[0].etype != ETYPE_UNION)
-    abort ();
+    __builtin_abort ();
   for (i = 0; i <= e[0].len; ++i)
     {
       ret = iterative_hash (&e[i], __builtin_offsetof (struct entry, attrib), ret);
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-4.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-4.c
index 8ce7ad1c5cb..0da549b049a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-4.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-4.c
@@ -56,6 +56,9 @@ struct cse_reg_info
 };
 static struct cse_reg_info *cse_reg_info_table;
 static unsigned int cse_reg_info_timestamp;
+int rhs_regno (rtx);
+void foop (void);
+void arf (void);
 
 static __inline__ struct cse_reg_info *
 get_cse_reg_info (unsigned int regno)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-5.c b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-5.c
index 7eee1b8877d..f4e74213547 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr68619-5.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr68619-5.c
@@ -134,6 +134,8 @@ union tree_node
   struct tree_typed typed;
   struct tree_type type;
 };
+enum tree_code invert_tree_comparison (enum tree_code, int);
+int vector_type_mode (tree);
 enum tree_code
 parse_predicate (tree cond, tree * op0, tree * op1)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c
index b617f2df302..88af5f550ba 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-2.c
@@ -15,6 +15,12 @@ typedef struct immediate_use_iterator_d
 {
 }
 imm_use_iterator;
+int arf (void);
+int gimple_debug_bind_p (gimple);
+int gimple_bb (gimple);
+tree gimple_assign_rhs_to_tree (void);
+int is_gimple_min_invariant (tree);
+tree unshare_expr (tree);
 void
 insert_debug_temp_for_var_def (gimple stmt)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-3.c b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-3.c
index 5ffd5f71506..974961cedef 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/pr69270-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr69270-3.c
@@ -7,6 +7,11 @@
 
 typedef long unsigned int size_t;
 typedef union gimple_statement_d *gimple;
+int end_imm_use_stmt_p (void);
+void next_imm_use_stmt (void);
+int arf (void);
+int boo (void);
+void update_stmt (void);
 unsigned char
 propagate_with_phi ()
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c
index 163d9e1cf08..d60fecbeb5c 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-2.c
@@ -13,13 +13,14 @@ union gimple_statement_d
   unsigned num_ops;
   tree exp;
 };
+void gimple_call_arg (gimple, unsigned);
 
 unsigned int x;
 static inline tree
 gimple_op (const_gimple gs, unsigned i)
 {
   if (!(i < gs->num_ops))
-    abort ();
+    __builtin_abort ();
   return gs->exp;
 }
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c
index 79ec067e68a..c430bc2806e 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ranger-threader-3.c
@@ -13,6 +13,7 @@ enum optab_methods
 };
 struct optab_d { };
 typedef struct optab_d *optab;
+void expand_binop (optab, int, enum optab_methods);
 void
 expand_shift_1 (int code, int unsignedp, int rotate,
 		optab lshift_optab, optab rshift_arith_optab)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/split-path-3.c b/gcc/testsuite/gcc.dg/tree-ssa/split-path-3.c
index 814504af97f..f6a29f628a2 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/split-path-3.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/split-path-3.c
@@ -33,6 +33,8 @@ typedef struct VEC_int_heap
   VEC_int_base base;
 }
 VEC_int_heap;
+void *vec_heap_o_reserve (VEC_int_heap *, int, __SIZE_TYPE__, __SIZE_TYPE__);
+int VEC_int_base_length (VEC_int_base *);
 static __inline__ int
 VEC_int_heap_reserve (VEC_int_heap ** vec_, int alloc_, const char *file_,
 		      unsigned line_, const char *function_)
@@ -66,6 +68,11 @@ typedef struct
 {
 }
 bitmap_iterator;
+int bmp_iter_and_compl_init (bitmap_iterator *, bitmap_head *, bitmap, int,
+			     int *);
+int bmp_iter_and_compl (bitmap_iterator *, int *);
+void bmp_iter_next (bitmap_iterator *, int *);
+void VEC_int_heap_free (VEC_int_heap **);
 bitmap
 compute_idf (bitmap_head * dfs)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c b/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
index a5df75c9b72..252fe06c666 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/split-path-7.c
@@ -85,8 +85,8 @@ linit ()
 	    }
 	}
       if (!viazero && ind->numents >= 4
-	  && strcmp ((char *) (entry->affix),
-		     (char *) (ind->pu.ent->affix)) != 0)
+	  && __builtin_strcmp ((char *) (entry->affix),
+			       (char *) (ind->pu.ent->affix)) != 0)
 	{
 	}
     }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-branch-1.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-branch-1.c
index ede3274f59d..8cdf15843e9 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-branch-1.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-branch-1.c
@@ -7,14 +7,16 @@ struct rtx_def
   int code;
   rtx rt_rtx;
 };
+int arf (void);
+int foo (void);
 rtx
 try_combine (rtx i1, rtx newpat)
 {
   rtx temp;
-  if (i1 && (temp = ((((((newpat->rt_rtx, ((((temp)->code) == 42)))))))))
+  if (i1 && (temp = (rtx) ((((((newpat->rt_rtx, ((((temp)->code) == 42)))))))))
       && ((temp =
-	(((((((((((newpat)->rt_rtx),
-		 ((((temp)->code) == 42) && arf ())))))))))))))
+	   (rtx) (((((((((((newpat)->rt_rtx),
+			  ((((temp)->code) == 42) && arf ())))))))))))))
     ;
   else if (i1 && foo ());
 }
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c
index e68acbbc5d9..3f8b6ee4342 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-12.c
@@ -10,13 +10,14 @@ union gimple_statement_d
   unsigned num_ops;
   tree exp;
 };
+void gimple_call_arg (gimple, unsigned);
 
 unsigned int x;
 static inline tree
 gimple_op (const_gimple gs, unsigned i)
 {
   if (!(i < gs->num_ops))
-    abort ();
+    __builtin_abort ();
   return gs->exp;
 }
 
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c
index fd99bfbf789..67e5fbd59b1 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-13.c
@@ -23,6 +23,8 @@ union tree_node
   struct tree_typed typed;
   struct tree_type_common type_common;
 };
+tree arf (void);
+void error (const char *);
 tree
 convert (tree type, tree expr)
 {
@@ -31,7 +33,7 @@ convert (tree type, tree expr)
   const char *invalid_conv_diag;
   tree ret;
   if (tree_contains_struct[expr->base.code][(42)] != 1)
-    abort ();
+    __builtin_abort ();
   if (type->type_common.main_variant == expr->typed.type->type_common.main_variant
       && (expr->typed.type->base.code != 123
 	  || e->base.code == 456))
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c
index 8497ed6b4a4..2c1e2b2a076 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-14.c
@@ -12,6 +12,7 @@ enum optab_methods
 };
 struct optab_d { };
 typedef struct optab_d *optab;
+void expand_binop (optab, int, enum optab_methods);
 void
 expand_shift_1 (int code, int unsignedp, int rotate,
 		optab lshift_optab, optab rshift_arith_optab)
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-15.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-15.c
index df6a9b32eb1..f7fd0eadb09 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-15.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dom-thread-15.c
@@ -40,6 +40,10 @@ struct ix86_frame
 {
   long stack_pointer_offset;
 };
+int ix86_target_stack_probe (void);
+int pro_epilogue_adjust_stack (rtx, rtx, rtx, int, int);
+rtx gen_rtx_CONST_INT (int);
+void fancy_abort (const char *, int, const char *);
 void
 ix86_expand_prologue (void)
 {
diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-25.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-25.c
index 8b7db3a2385..cc00b735653 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-25.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-dse-25.c
@@ -7,8 +7,8 @@ char z[32];
 int
 foo(void)
 {
-  memset (z, 0, 16);
-  memset (z+8, 0, 24);
+  __builtin_memset (z, 0, 16);
+  __builtin_memset (z+8, 0, 24);
 }
 
 /* { dg-final { scan-tree-dump "memset .&z, 0, 8." "dse1" } } */
diff --git a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c
index 24895c3ab48..59fc21750c8 100644
--- a/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c
+++ b/gcc/testsuite/gcc.target/aarch64/aapcs64/va_arg-17.c
@@ -28,8 +28,8 @@ union S2844 a2844[5];
 #define HAS_DATA_INIT_FUNC
 void init_data ()
 {
-  memset (&s2844, '\0', sizeof (s2844));
-  memset (a2844, '\0', sizeof (a2844));
+  __builtin_memset (&s2844, '\0', sizeof (s2844));
+  __builtin_memset (a2844, '\0', sizeof (a2844));
   s2844.a = 799U;
   a2844[2].a = 586U;
 }
diff --git a/gcc/testsuite/gcc.target/i386/pr69030.c b/gcc/testsuite/gcc.target/i386/pr69030.c
index 30919c72c91..c3f63a43fc5 100644
--- a/gcc/testsuite/gcc.target/i386/pr69030.c
+++ b/gcc/testsuite/gcc.target/i386/pr69030.c
@@ -13,7 +13,7 @@ static unsigned fn1() {
     j = a;
     a = (a && (g % f && i) % h) | c | ~2;
     if (b)
-      printf("", 1);
+      __builtin_printf("", 1);
   }
   c = i;
   a = j;
