diff --git a/gcc/cccp.c b/gcc/cccp.c
index a21daf1d5105e5f71e6595bce1966dac1385f8d7..4acc21470c44d374ac65eacbc4f35bb687d61e78 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -1454,7 +1454,11 @@ main (argc, argv)
 	if (! strcmp (argv[i], "-lang-c"))
 	  cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
 	else if (! strcmp (argv[i], "-lang-c89"))
-	  cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	  {
+	    cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	    no_trigraphs = 0;
+	    pend_defs[i] = "__STRICT_ANSI__=199000";
+	  }
 	else if (! strcmp (argv[i], "-lang-c++"))
 	  cplusplus = 1, cplusplus_comments = 1, c89 = 0, c9x = 0, objc = 0;
 	else if (! strcmp (argv[i], "-lang-objc"))
@@ -1472,15 +1476,37 @@ main (argc, argv)
 	break;
 
       case 's':
-	if (!strcmp (argv[i], "-std=iso9899:1990")
-	    || !strcmp (argv[i], "-std=iso9899:199409")
-	    || !strcmp (argv[i], "-std=c89")
-	    || !strcmp (argv[i], "-std=gnu89"))
-	  cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	if (!strcmp (argv[i], "-std=gnu89"))
+	  {
+	    cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	  }
+	else if (!strcmp (argv[i], "-std=gnu9x")
+		 || !strcmp (argv[i], "-std=gnu99"))
+	  {
+	    cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+	  }
+	else if (!strcmp (argv[i], "-std=iso9899:1990")
+		 || !strcmp (argv[i], "-std=c89"))
+	  {
+	    cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	    no_trigraphs = 0;
+	    pend_defs[i] = "__STRICT_ANSI__=199000";
+	  }
+	else if (!strcmp (argv[i], "-std=iso9899:199409"))
+	  {
+	    cplusplus = 0, cplusplus_comments = 0, c89 = 1, c9x = 0, objc = 0;
+	    no_trigraphs = 0;
+	    pend_defs[i] = "__STRICT_ANSI__=199409";
+	  }
         else if (!strcmp (argv[i], "-std=iso9899:199x")
+		 || !strcmp (argv[i], "-std=iso9899:1999")
 		 || !strcmp (argv[i], "-std=c9x")
-		 || !strcmp (argv[i], "-std=gnu9x"))
-	  cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+		 || !strcmp (argv[i], "-std=c99"))
+	  {
+	    cplusplus = 0, cplusplus_comments = 1, c89 = 0, c9x = 1, objc = 0;
+	    no_trigraphs = 0;
+	    pend_defs[i] = "__STRICT_ANSI__=199900";
+	  }
 	break;
 
       case 'w':
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index 4343b23ab836dc5b6bcce0c11a95f069a07801c1..3ffda8a337cbb52cfd2801a4c9896dffe996b50b 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -1069,6 +1069,20 @@ cpp_finish (pfile)
     }
 }
 
+static void
+new_pending_define (opts, text)
+     struct cpp_options *opts;
+     const char *text;
+{
+  struct pending_option *o = (struct pending_option *)
+    xmalloc (sizeof (struct pending_option));
+
+  o->arg = text;
+  o->next = NULL;
+  o->undef = 0;
+  APPEND (opts->pending, define, o);
+}
+
 /* Handle one command-line option in (argc, argv).
    Can be called multiple times, to handle multiple sets of options.
    Returns number of strings consumed.  */
@@ -1313,8 +1327,12 @@ cpp_handle_option (pfile, argc, argv)
 	  opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
 	    opts->c9x = 1, opts->objc = 0;
 	if (! strcmp (argv[i], "-lang-c89"))
-	  opts->cplusplus = 0, opts->cplusplus_comments = 0, opts->c89 = 1,
-	    opts->c9x = 0, opts->objc = 0;
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 0;
+	    opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+	    opts->trigraphs = 1;
+	    new_pending_define (opts, "__STRICT_ANSI__=199000");
+	  }
 	if (! strcmp (argv[i], "-lang-c++"))
 	  opts->cplusplus = 1, opts->cplusplus_comments = 1, opts->c89 = 0,
 	    opts->c9x = 0, opts->objc = 0;
@@ -1338,17 +1356,41 @@ cpp_handle_option (pfile, argc, argv)
 	break;
 
       case 's':
-	if (!strcmp (argv[i], "-std=iso9899:1990")
-	    || !strcmp (argv[i], "-std=iso9899:199409")
-	    || !strcmp (argv[i], "-std=c89")
-	    || !strcmp (argv[i], "-std=gnu89"))
-	  opts->cplusplus = 0, opts->cplusplus_comments = 0,
+	if (!strcmp (argv[i], "-std=gnu89"))
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 0;
+	    opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+	  }
+	else if (!strcmp (argv[i], "-std=gnu9x"))
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 1;
+	    opts->c89 = 0, opts->c9x = 1, opts->objc = 0;
+	  }
+	else if (!strcmp (argv[i], "-std=iso9899:1990")
+		 || !strcmp (argv[i], "-std=c89"))
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 0;
 	    opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+	    opts->trigraphs = 1;
+	    new_pending_define (opts, "__STRICT_ANSI__=199000");
+	  }
+	else if (!strcmp (argv[i], "-std=iso9899:199409"))
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 0;
+	    opts->c89 = 1, opts->c9x = 0, opts->objc = 0;
+	    opts->trigraphs = 1;
+	    new_pending_define (opts, "__STRICT_ANSI__=199409");
+	  }
 	else if (!strcmp (argv[i], "-std=iso9899:199x")
+		 || !strcmp (argv[i], "-std=iso9899:1999")
 		 || !strcmp (argv[i], "-std=c9x")
-		 || !strcmp (argv[i], "-std=gnu9x"))
-	  opts->cplusplus = 0, opts->cplusplus_comments = 1, opts->c89 = 0,
-	    opts->c9x = 1, opts->objc = 0;
+		 || !strcmp (argv[i], "-std=c99"))
+	  {
+	    opts->cplusplus = 0, opts->cplusplus_comments = 1;
+	    opts->c89 = 0, opts->c9x = 1, opts->objc = 0;
+	    opts->trigraphs = 1;
+	    new_pending_define (opts, "__STRICT_ANSI__=199900");
+	  }
 	break;
 
       case 'w':
@@ -1487,21 +1529,17 @@ cpp_handle_option (pfile, argc, argv)
       
       case 'D':
 	{
-	  struct pending_option *o = (struct pending_option *)
-	    xmalloc (sizeof (struct pending_option));
+	  const char *text;
 	  if (argv[i][2] != 0)
-	    o->arg = argv[i] + 2;
+	    text = argv[i] + 2;
 	  else if (i + 1 == argc)
 	    {
 	      cpp_fatal (pfile, "Macro name missing after -D option");
 	      return argc;
 	    }
 	  else
-	    o->arg = argv[++i];
-
-	  o->next = NULL;
-	  o->undef = 0;
-	  APPEND (opts->pending, define, o);
+	    text = argv[++i];
+	  new_pending_define (opts, text);
 	}
 	break;
       
diff --git a/gcc/gcc.c b/gcc/gcc.c
index e6ae802f40c2c2035e7e30e62729dff71f295f4b..0230b49847312591db825e1eb8db2294f5fbc21b 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -628,7 +628,6 @@ static struct compiler default_compilers[] =
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\
-	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
 	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
 	%{ffast-math:-D__FAST_MATH__}\
@@ -643,7 +642,6 @@ static struct compiler default_compilers[] =
                   %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\
                   %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
                   %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\
-		  %{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
 		  %{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
                   %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
 		  %{ffast-math:-D__FAST_MATH__}\
@@ -667,7 +665,6 @@ static struct compiler default_compilers[] =
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\
-	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
 	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
 	%{ffast-math:-D__FAST_MATH__}\
@@ -696,7 +693,6 @@ static struct compiler default_compilers[] =
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\
-	%{ansi|std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
 	%{!undef:%{!ansi:%{!std=*:%p}%{std=gnu*:%p}} %P} %{trigraphs}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
 	%{ffast-math:-D__FAST_MATH__}\
@@ -714,7 +710,6 @@ static struct compiler default_compilers[] =
 	%{C:%{!E:%eGNU C does not support -C without using -E}}\
 	%{M} %{MM} %{MD:-MD %b.d} %{MMD:-MMD %b.d} %{MG}\
         %{!no-gcc:-D__GNUC__=%v1 -D__GNUC_MINOR__=%v2}\
-	%{std=*:%{!std=gnu*:-trigraphs -D__STRICT_ANSI__}}\
 	%{!undef:%{!std=*:%p}%{std=gnu*:%p} %P} %{trigraphs}\
         %c %{Os:-D__OPTIMIZE_SIZE__} %{O*:%{!O0:-D__OPTIMIZE__}}\
 	%{ffast-math:-D__FAST_MATH__}\
diff --git a/gcc/ginclude/stdarg.h b/gcc/ginclude/stdarg.h
index 923ac3c64537bcd5f2a73111cf54a9008a240bc3..c74c80d392bb95f16a21454b66082d696f459b18 100644
--- a/gcc/ginclude/stdarg.h
+++ b/gcc/ginclude/stdarg.h
@@ -54,7 +54,10 @@ typedef __builtin_va_list __gnuc_va_list;
 #define va_start(v,l)	__builtin_stdarg_start(&(v),l)
 #define va_end		__builtin_va_end
 #define va_arg		__builtin_va_arg
+#if defined(__STRICT_ANSI__) && __STRICT_ANSI__ + 0 < 199900
 #define va_copy(d,s)	__builtin_va_copy(&(d),(s))
+#endif
+#define __va_copy(d,s)	__builtin_va_copy(&(d),(s))
 
 
 /* Define va_list, if desired, from __gnuc_va_list. */