[Bug fortran/55591] strict-aliasing & Fortran

Joost.VandeVondele at mat dot ethz.ch gcc-bugzilla@gcc.gnu.org
Fri Mar 29 06:13:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55591

--- Comment #5 from Joost VandeVondele <Joost.VandeVondele at mat dot ethz.ch> 2013-03-29 06:13:38 UTC ---
(In reply to comment #3)
> Untested (but successfully compiled) patch:
> 
> --- a/gcc/fortran/options.c
> +++ b/gcc/fortran/options.c
> @@ -170,4 +170,6 @@ gfc_init_options (unsigned int decoded_options_count,
>    set_default_std_flags ();
> 
> +  flag_strict_aliasing = -1;
> +
>    /* Initialize cpp-related options.  */
>    gfc_cpp_init_options (decoded_options_count, decoded_options);
> @@ -275,4 +277,8 @@ gfc_post_options (const char **pfilename)
>      gfc_option.flag_whole_file = 1;
> 
> +  /* By default use strict-aliasing semantics.  */
> +  if (flag_strict_aliasing == -1)
> +    flag_strict_aliasing = 1;
> +
>    /* Fortran allows associative math - but we cannot reassociate if
>       we want traps or signed zeros. Cf. also flag_protect_parens.  */

what about applying this to stage 1 4.9 ?



More information about the Gcc-bugs mailing list