From d9068c61428f89ce1db4bae6f5adb6acbd8b5b6b Mon Sep 17 00:00:00 2001
From: Hans-Peter Nilsson <hp@axis.com>
Date: Mon, 13 Nov 2000 21:22:10 +0000
Subject: [PATCH] c-lex.c (cb_leave_file): Harmonize conditions and order of
 statements to those of process_directive for...

	* c-lex.c (cb_leave_file): Harmonize conditions and order of
	statements to those of process_directive for (action == act_pop).

	* collect2.c (main): Pass on -B options from COLLECT_GCC_OPTIONS.

	* local-alloc.c (equiv_init_movable_p): References to CC0 are not
	movable.

From-SVN: r37438
---
 gcc/ChangeLog     | 10 ++++++++++
 gcc/c-lex.c       | 44 ++++++++++++++++++++++++--------------------
 gcc/collect2.c    |  9 +++++++++
 gcc/local-alloc.c |  1 +
 4 files changed, 44 insertions(+), 20 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index bf184f5d3ef7..86ce5acbee9f 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,13 @@
+2000-11-13  Hans-Peter Nilsson  <hp@axis.com>
+
+	* c-lex.c (cb_leave_file): Harmonize conditions and order of
+	statements to those of process_directive for (action == act_pop).
+
+	* collect2.c (main): Pass on -B options from COLLECT_GCC_OPTIONS.
+
+	* local-alloc.c (equiv_init_movable_p): References to CC0 are not
+	movable.
+
 2000-11-13  Joseph S. Myers  <jsm28@cam.ac.uk>
 
 	* c-parse.in (stmts_and_decls): Deprecate use of label at end of
diff --git a/gcc/c-lex.c b/gcc/c-lex.c
index 0c4fa916558f..7f1160481bf8 100644
--- a/gcc/c-lex.c
+++ b/gcc/c-lex.c
@@ -728,30 +728,34 @@ cb_leave_file (pfile)
 {
   /* Bleah, need a better interface to this.  */
   const char *flags = cpp_syshdr_flags (pfile, CPP_BUFFER (pfile));
-#if 0
-  if (indent_level != input_file_stack->indent_level)
-    {
-      warning_with_file_and_line
-	(input_filename, lex_lineno,
-	 "This file contains more '%c's than '%c's.",
-	 indent_level > input_file_stack->indent_level ? '{' : '}',
-	 indent_level > input_file_stack->indent_level ? '}' : '{');
-    }
-#endif
-  /* We get called for the main buffer, but we mustn't pop it.  */
+
   if (input_file_stack->next)
-    pop_srcloc ();
-  in_system_header = (flags[0] != 0);
-#ifndef NO_IMPLICIT_EXTERN_C
-  if (c_header_level && --c_header_level == 0)
     {
-      if (flags[2] != 0)
-	warning ("badly nested C headers from preprocessor");
-      --pending_lang_change;
-    }
+#ifndef NO_IMPLICIT_EXTERN_C
+      if (c_header_level && --c_header_level == 0)
+	{
+	  if (flags[2] != 0)
+	    warning ("badly nested C headers from preprocessor");
+	  --pending_lang_change;
+	}
 #endif
+#if 0
+      if (indent_level != input_file_stack->indent_level)
+	{
+	  warning_with_file_and_line
+	    (input_filename, lex_lineno,
+	     "This file contains more '%c's than '%c's.",
+	     indent_level > input_file_stack->indent_level ? '{' : '}',
+	     indent_level > input_file_stack->indent_level ? '}' : '{');
+	}
+#endif
+      /* We get called for the main buffer, but we mustn't pop it.  */
+      pop_srcloc ();
+      debug_end_source_file (input_file_stack->line);
+    }
+
+  in_system_header = (flags[0] != 0);
   lex_lineno = CPP_BUFFER (pfile)->lineno;
-  debug_end_source_file (input_file_stack->line);
 
   update_header_times (input_file_stack->name);
   /* Hook for C++.  */
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 827772392a7f..49cb0e73d752 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -1096,6 +1096,15 @@ main (argc, argv)
 	*c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
       if (strncmp (q, "-shared", sizeof ("-shared") - 1) == 0)
 	shared_obj = 1;
+      if (*q == '-' && q[1] == 'B')
+	{
+	  *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+	  if (q[2] == 0)
+	    {
+	      q = extract_string (&p);
+	      *c_ptr++ = obstack_copy0 (&permanent_obstack, q, strlen (q));
+	    }
+	}
     }
   obstack_free (&temporary_obstack, temporary_firstobj);
   *c_ptr++ = "-fno-exceptions";
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index 2315338756bb..ac2183e02f46 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -589,6 +589,7 @@ equiv_init_movable_p (x, regno)
     case SET:
       return equiv_init_movable_p (SET_SRC (x), regno);
 
+    case CC0:
     case CLOBBER:
       return 0;
 
-- 
GitLab