Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2014-01-07 Thread Robert Dewar
On 1/7/2014 8:46 PM, Andrew Pinski wrote: Correctness over speed is better. I am sorry GCC is the only one which gets it correct here. If people don't like there is a flag to disable it. Obviously in a case like this, it is the programmer who should be able to decide between fast-and-accepta

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2014-01-07 Thread Andrew Pinski
On Thu, Nov 14, 2013 at 11:12 AM, Xinliang David Li wrote: > On Thu, Nov 14, 2013 at 10:17 AM, Andrew Pinski wrote: >> On Thu, Nov 14, 2013 at 8:25 AM, Xinliang David Li >> wrote: >>> Can we revisit the decision for this? Here are the reasons: >>> >>> 1) It seems that the motivation to make C++

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-14 Thread Xinliang David Li
On Thu, Nov 14, 2013 at 10:17 AM, Andrew Pinski wrote: > On Thu, Nov 14, 2013 at 8:25 AM, Xinliang David Li wrote: >> Can we revisit the decision for this? Here are the reasons: >> >> 1) It seems that the motivation to make C++ consistent with c99 is to >> avoid confusing users who build the C so

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-14 Thread Cong Hou
See the following code: #include using std::complex; template complex<_Tp>& mult_assign (complex<_Tp>& __y, const complex<_Up>& __z) { _Up& _M_real = __y.real(); _Up& _M_imag = __y.imag(); const _Tp __r = _M_real * __z.real() - _M_imag * __z.imag(); _M_imag = _M_real * __z.imag() + _M_i

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-14 Thread Andrew Pinski
On Thu, Nov 14, 2013 at 8:25 AM, Xinliang David Li wrote: > Can we revisit the decision for this? Here are the reasons: > > 1) It seems that the motivation to make C++ consistent with c99 is to > avoid confusing users who build the C source with both C and C++ > compilers. Why should C++'s default

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-14 Thread Xinliang David Li
Can we revisit the decision for this? Here are the reasons: 1) It seems that the motivation to make C++ consistent with c99 is to avoid confusing users who build the C source with both C and C++ compilers. Why should C++'s default behavior be tuned for this niche case? 2) It is very confusing for

Re: [PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-13 Thread Andrew Pinski
On Wed, Nov 13, 2013 at 5:26 PM, Cong Hou wrote: > This patch is for PR58963. > > In the patch http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00560.html, > the builtin function is used to perform complex multiplication and > division. This is to comply with C99 standard, but I am wondering if > C++

[PATCH] Do not set flag_complex_method to 2 for C++ by default.

2013-11-13 Thread Cong Hou
This patch is for PR58963. In the patch http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00560.html, the builtin function is used to perform complex multiplication and division. This is to comply with C99 standard, but I am wondering if C++ also needs this. There is no complex keyword in C++, and no