[GOOGLE] Prevent x_flag_complex_method to be set to 2 for C++.

Xinliang David Li davidxl@google.com
Wed Feb 12 01:35:00 GMT 2014


ok.

David

On Tue, Feb 11, 2014 at 5:30 PM, Cong Hou <congh@google.com> wrote:
> With this patch x_flag_complex_method won't be set to 2 for C++ so
> that multiply/divide between std::complex objects won't be replaced by
> expensive builtin function calls.
>
> Bootstrapped and passed regression test.
>
> OK for Google branch?
>
>
> thanks,
> Cong
>
>
>
> Index: gcc/c-family/c-opts.c
> ===================================================================
> --- gcc/c-family/c-opts.c (revision 207701)
> +++ gcc/c-family/c-opts.c (working copy)
> @@ -204,8 +204,10 @@ c_common_init_options_struct (struct gcc
>    opts->x_warn_write_strings = c_dialect_cxx ();
>    opts->x_flag_warn_unused_result = true;
>
> -  /* By default, C99-like requirements for complex multiply and divide.  */
> -  opts->x_flag_complex_method = 2;
> +  /* By default, C99-like requirements for complex multiply and divide.
> +     But for C++ this should not be required.  */
> +  if (c_language != clk_cxx)
> +    opts->x_flag_complex_method = 2;
>  }
>
>  /* Common initialization before calling option handlers.  */



More information about the Gcc-patches mailing list