Patchwork Make set_fast_math_flags and set_unsafe_math_optimizations_flags static

login
register
mail settings
Submitter Joseph S. Myers
Date Oct. 16, 2010, 1:16 a.m.
Message ID <Pine.LNX.4.64.1010160116220.1028@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/68016/
State New
Headers show

Comments

Joseph S. Myers - Oct. 16, 2010, 1:16 a.m.
After my RX options cleanup
<http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01331.html> nothing
outside of opts.c uses set_fast_math_flags.  Also, nothing outside of
opts.c uses set_unsafe_math_optimizations_flags.  This patch makes
those functions static, removing their prototypes from toplev.h (which
isn't a good place to prototype functions in opts.c anyway; opts.h or
flags.h would be better).

Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  OK to
commit?

2010-10-15  Joseph Myers  <joseph@codesourcery.com>

	* opts.c (set_fast_math_flags,
	set_unsafe_math_optimizations_flags): Make static.
	* toplev.h (set_fast_math_flags,
	set_unsafe_math_optimizations_flags): Remove prototypes.
Richard Guenther - Oct. 16, 2010, 9:08 a.m.
On Sat, Oct 16, 2010 at 3:16 AM, Joseph S. Myers
<joseph@codesourcery.com> wrote:
> After my RX options cleanup
> <http://gcc.gnu.org/ml/gcc-patches/2010-10/msg01331.html> nothing
> outside of opts.c uses set_fast_math_flags.  Also, nothing outside of
> opts.c uses set_unsafe_math_optimizations_flags.  This patch makes
> those functions static, removing their prototypes from toplev.h (which
> isn't a good place to prototype functions in opts.c anyway; opts.h or
> flags.h would be better).
>
> Bootstrapped with no regressions on x86_64-unknown-linux-gnu.  OK to
> commit?

Ok.

Thanks,
Richard.

> 2010-10-15  Joseph Myers  <joseph@codesourcery.com>
>
>        * opts.c (set_fast_math_flags,
>        set_unsafe_math_optimizations_flags): Make static.
>        * toplev.h (set_fast_math_flags,
>        set_unsafe_math_optimizations_flags): Remove prototypes.
>
> diff -rupN --exclude=.svn gcc-mainline-0/gcc/opts.c gcc-mainline/gcc/opts.c
> --- gcc-mainline-0/gcc/opts.c   2010-10-15 14:45:36.000000000 -0700
> +++ gcc-mainline/gcc/opts.c     2010-10-15 16:38:35.000000000 -0700
> @@ -369,6 +369,8 @@ static void complain_wrong_lang (const s
>                                 unsigned int lang_mask);
>  static void set_debug_level (enum debug_info_type type, int extended,
>                             const char *arg);
> +static void set_fast_math_flags (int set);
> +static void set_unsafe_math_optimizations_flags (int set);
>
>  /* Return a malloced slash-separated list of languages in MASK.  */
>  static char *
> @@ -2175,7 +2177,7 @@ set_Wstrict_aliasing (int onoff)
>
>  /* The following routines are useful in setting all the flags that
>    -ffast-math and -fno-fast-math imply.  */
> -void
> +static void
>  set_fast_math_flags (int set)
>  {
>   flag_unsafe_math_optimizations = set;
> @@ -2192,7 +2194,7 @@ set_fast_math_flags (int set)
>
>  /* When -funsafe-math-optimizations is set the following
>    flags are set as well.  */
> -void
> +static void
>  set_unsafe_math_optimizations_flags (int set)
>  {
>   flag_trapping_math = !set;
> diff -rupN --exclude=.svn gcc-mainline-0/gcc/toplev.h gcc-mainline/gcc/toplev.h
> --- gcc-mainline-0/gcc/toplev.h 2010-09-29 07:52:47.000000000 -0700
> +++ gcc-mainline/gcc/toplev.h   2010-10-15 16:37:35.000000000 -0700
> @@ -98,13 +98,6 @@ extern const char * default_pch_valid_p
>  /* The hashtable, so that the C front ends can pass it to cpplib.  */
>  extern struct ht *ident_hash;
>
> -/* This function can be used by targets to set the flags originally
> -    implied by -ffast-math and -fno-fast-math.  */
> -
> -extern void set_fast_math_flags         (int);
> -
> -extern void set_unsafe_math_optimizations_flags (int);
> -
>  /* Handle -d switch.  */
>  extern void decode_d_option            (const char *);
>
>
> --
> Joseph S. Myers
> joseph@codesourcery.com
>

Patch

diff -rupN --exclude=.svn gcc-mainline-0/gcc/opts.c gcc-mainline/gcc/opts.c
--- gcc-mainline-0/gcc/opts.c	2010-10-15 14:45:36.000000000 -0700
+++ gcc-mainline/gcc/opts.c	2010-10-15 16:38:35.000000000 -0700
@@ -369,6 +369,8 @@  static void complain_wrong_lang (const s
 				 unsigned int lang_mask);
 static void set_debug_level (enum debug_info_type type, int extended,
 			     const char *arg);
+static void set_fast_math_flags (int set);
+static void set_unsafe_math_optimizations_flags (int set);
 
 /* Return a malloced slash-separated list of languages in MASK.  */
 static char *
@@ -2175,7 +2177,7 @@  set_Wstrict_aliasing (int onoff)
 
 /* The following routines are useful in setting all the flags that
    -ffast-math and -fno-fast-math imply.  */
-void
+static void
 set_fast_math_flags (int set)
 {
   flag_unsafe_math_optimizations = set;
@@ -2192,7 +2194,7 @@  set_fast_math_flags (int set)
 
 /* When -funsafe-math-optimizations is set the following
    flags are set as well.  */
-void
+static void
 set_unsafe_math_optimizations_flags (int set)
 {
   flag_trapping_math = !set;
diff -rupN --exclude=.svn gcc-mainline-0/gcc/toplev.h gcc-mainline/gcc/toplev.h
--- gcc-mainline-0/gcc/toplev.h	2010-09-29 07:52:47.000000000 -0700
+++ gcc-mainline/gcc/toplev.h	2010-10-15 16:37:35.000000000 -0700
@@ -98,13 +98,6 @@  extern const char * default_pch_valid_p 
 /* The hashtable, so that the C front ends can pass it to cpplib.  */
 extern struct ht *ident_hash;
 
-/* This function can be used by targets to set the flags originally
-    implied by -ffast-math and -fno-fast-math.  */
-
-extern void set_fast_math_flags         (int);
-
-extern void set_unsafe_math_optimizations_flags (int);
-
 /* Handle -d switch.  */
 extern void decode_d_option		(const char *);