This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] toplev.c tweak


I'm trying to keep the initialization code in toplev.c clean;
someone confused it a bit with randomize().  This puts just one
call to randomize() in its correct location.

OK to commit?  Bootstrapped x86 NetBSD C,ObjC,C++ no regressions.

Neil.

	* toplev.c (print_switch_values, toplev_main): Remove calls to
	randomize().
	(process_options): Call randomize here.

Index: toplev.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/toplev.c,v
retrieving revision 1.817
diff -u -p -r1.817 toplev.c
--- toplev.c	8 Aug 2003 19:22:42 -0000	1.817
+++ toplev.c	9 Aug 2003 19:09:19 -0000
@@ -3817,10 +3817,6 @@ print_switch_values (FILE *file, int pos
   size_t j;
   const char **p;
 
-  /* Fill in the -frandom-seed option, if the user didn't pass it, so
-     that it can be printed below.  This helps reproducibility.  */
-  randomize ();
-
   /* Print the options as passed.  */
   pos = print_single_switch (file, pos, max, indent, *indent ? " " : "", term,
 			     _("options passed: "), "");
@@ -4132,15 +4128,6 @@ process_options (void)
 		 flag_leading_underscore ? "" : "no-");
     }
 
-  /* If we are in verbose mode, write out the version and maybe all the
-     option flags in use.  */
-  if (version_flag)
-    {
-      print_version (stderr, "");
-      if (! quiet_flag)
-	print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
-    }
-
   if (flag_syntax_only)
     {
       write_symbols = NO_DEBUG;
@@ -4241,9 +4228,20 @@ process_options (void)
     warning ("-ffunction-sections may affect debugging on some targets");
 #endif
 
-    /* The presence of IEEE signaling NaNs, implies all math can trap.  */
-    if (flag_signaling_nans)
-      flag_trapping_math = 1;
+  /* The presence of IEEE signaling NaNs, implies all math can trap.  */
+  if (flag_signaling_nans)
+    flag_trapping_math = 1;
+
+  randomize ();
+
+  /* If we are in verbose mode, write out the version and maybe all the
+     option flags in use.  Needs to come after call to randomize().  */
+  if (version_flag)
+    {
+      print_version (stderr, "");
+      if (! quiet_flag)
+	print_switch_values (stderr, 0, MAX_LINE, "", " ", "\n");
+    }
 }
 
 /* Initialize the compiler back end.  */
@@ -4440,8 +4438,6 @@ toplev_main (unsigned int argc, const ch
   /* Parse the options and do minimal processing; basically just
      enough to default flags appropriately.  */
   decode_options (argc, argv);
-
-  randomize ();
 
   /* Exit early if we can (e.g. -help).  */
   if (!exit_after_options)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]