Re: Should -ffp-contract=off the default on GCC?

2023-03-31 Thread Qing Zhao via Gcc-patches
> On Mar 24, 2023, at 3:42 PM, Andrew Pinski wrote: > > On Fri, Mar 24, 2023 at 1:14 AM Fangrui Song via Gcc-patches > wrote: >> >> On Wed, Mar 22, 2023 at 8:52 AM Qing Zhao via Gcc-patches >> wrote: >>> >>> >>> On Mar 22, 2023, at 9:57 AM, Richard Biener via Gcc-patches

Re: Should -ffp-contract=off the default on GCC?

2023-03-27 Thread Zeson via Gcc-patches
Any update on this thread discussion? And the thread was straying to the document of option and user-friendly stuff. So does the default value of -ffp-contract=fast obey the C/C++ language standard? But why does clang not obey? Or is it just compiler implement-dependent which is not specified

Re: Should -ffp-contract=off the default on GCC?

2023-03-24 Thread Andrew Pinski via Gcc-patches
On Fri, Mar 24, 2023 at 1:14 AM Fangrui Song via Gcc-patches wrote: > > On Wed, Mar 22, 2023 at 8:52 AM Qing Zhao via Gcc-patches > wrote: > > > > > > > > > On Mar 22, 2023, at 9:57 AM, Richard Biener via Gcc-patches > > > wrote: > > > > > > On Wed, Mar 22, 2023 at 1:26 PM Alexander Monakov

Re: Should -ffp-contract=off the default on GCC?

2023-03-24 Thread Fangrui Song via Gcc-patches
On Wed, Mar 22, 2023 at 8:52 AM Qing Zhao via Gcc-patches wrote: > > > > > On Mar 22, 2023, at 9:57 AM, Richard Biener via Gcc-patches > > wrote: > > > > On Wed, Mar 22, 2023 at 1:26 PM Alexander Monakov > > wrote: > >> > >> > >> On Wed, 22 Mar 2023, Richard Biener wrote: > >> > >>> I think

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Qing Zhao via Gcc-patches
> On Mar 22, 2023, at 9:57 AM, Richard Biener via Gcc-patches > wrote: > > On Wed, Mar 22, 2023 at 1:26 PM Alexander Monakov wrote: >> >> >> On Wed, 22 Mar 2023, Richard Biener wrote: >> >>> I think it's even less realistic to expect users to know the details of >>> floating-point math.

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Qing Zhao via Gcc-patches
> On Mar 22, 2023, at 8:33 AM, Alexander Monakov wrote: > > > On Mon, 20 Mar 2023, Jakub Jelinek via Gcc-patches wrote: > >> On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: >>> My question: is the above section the place in C standard “explicitly >>> allows

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Richard Biener via Gcc-patches
On Wed, Mar 22, 2023 at 1:26 PM Alexander Monakov wrote: > > > On Wed, 22 Mar 2023, Richard Biener wrote: > > > I think it's even less realistic to expect users to know the details of > > floating-point math. So I doubt any such sentence will be helpful > > besides spreading some FUD? > > I

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Alexander Monakov via Gcc-patches
On Mon, 20 Mar 2023, Jakub Jelinek via Gcc-patches wrote: > On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: > > My question: is the above section the place in C standard “explicitly > > allows contractions”? If not, where it is in C standard? > >

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Alexander Monakov via Gcc-patches
On Wed, 22 Mar 2023, Richard Biener wrote: > I think it's even less realistic to expect users to know the details of > floating-point math. So I doubt any such sentence will be helpful > besides spreading some FUD? I think it's closer to "fundamental notions" rather than "details". For users

Re: Should -ffp-contract=off the default on GCC?

2023-03-22 Thread Richard Biener via Gcc-patches
On Tue, Mar 21, 2023 at 7:18 PM Jeff Law via Gcc-patches wrote: > > > > On 3/21/23 12:12, Alexander Monakov wrote: > >>> Yes, it’s better to know the details of languages standard. -:) > >>> However, I don’t think that this is a realistic expectation to the > >>> compiler > >>> users: to know

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 05:28:52PM -0600, Jeff Law via Gcc-patches wrote: > On 3/21/23 13:12, Jakub Jelinek wrote: > > On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: > > > In addition to this, Standards have been changed from time to time. > > > > So, the user needs to

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 13:12, Jakub Jelinek wrote: On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: In addition to this, Standards have been changed from time to time. So, the user needs to know the standard they are compiling for. Anyway, talking again about contractions,

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jakub Jelinek via Gcc-patches
On Tue, Mar 21, 2023 at 07:01:36PM +, Qing Zhao via Gcc-patches wrote: > In addition to this, Standards have been changed from time to time. So, the user needs to know the standard they are compiling for. Anyway, talking again about contractions, it isn't anything new in the standard, C99

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 3:51 PM, Jeff Law wrote: > > > > On 3/21/23 13:01, Qing Zhao wrote: > >> The code previously worked now has some issue since we added some new stuff >> into standard, and the compiler added some new transformation based on this >> new stuff. Should the compiler issue

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 13:01, Qing Zhao wrote: The code previously worked now has some issue since we added some new stuff into standard, and the compiler added some new transformation based on this new stuff. Should the compiler issue some warnings to warn the users about such change? Then the user

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 1:59 PM, Jeff Law via Gcc-patches > wrote: > > > > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: >>> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: >>> >>> >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ...

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Toon Moene
On 3/21/23 19:03, Paul Koning via Gcc-patches wrote: Failure to understand the language is a common problem and we do try to emit various diagnostics to help developers avoid writing non-conformant code. But ultimately if a developer fails to understand the language standard, then they're

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 12:12, Alexander Monakov wrote: Yes, it’s better to know the details of languages standard. -:) However, I don’t think that this is a realistic expectation to the compiler users: to know all the details of a language standard. Umm, they really do need to know that stuff. If the

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Alexander Monakov via Gcc-patches
On Tue, 21 Mar 2023, Jeff Law via Gcc-patches wrote: > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: > > > >> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: > >> > >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches > >>> wrote: > >>> > >>> ... > >>> Most of the compiler users

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Paul Koning via Gcc-patches
> On Mar 21, 2023, at 1:59 PM, Jeff Law via Gcc-patches > wrote: > > > > On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: >>> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: >>> >>> >>> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ...

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Jeff Law via Gcc-patches
On 3/21/23 11:00, Qing Zhao via Gcc-patches wrote: On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches wrote: ... Most of the compiler users are not familiar with language standards, or no access to language standards. Without

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 21, 2023, at 12:56 PM, Paul Koning wrote: > > > >> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches >> wrote: >> >> ... >> Most of the compiler users are not familiar with language standards, or no >> access to language standards. Without clearly documenting such warnings

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Paul Koning via Gcc-patches
> On Mar 21, 2023, at 11:01 AM, Qing Zhao via Gcc-patches > wrote: > > ... > Most of the compiler users are not familiar with language standards, or no > access to language standards. Without clearly documenting such warnings along > with the option explicitly, the users have not way to

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
> On Mar 20, 2023, at 6:25 PM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: >> My question: is the above section the place in C standard “explicitly allows >> contractions”? If not, where it is in C standard? > >

Re: Should -ffp-contract=off the default on GCC?

2023-03-21 Thread Qing Zhao via Gcc-patches
Thanks a lot for the info. Qing > On Mar 20, 2023, at 6:25 PM, Jakub Jelinek wrote: > > On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: >> My question: is the above section the place in C standard “explicitly allows >> contractions”? If not, where it is in C

Re: Should -ffp-contract=off the default on GCC?

2023-03-20 Thread Jakub Jelinek via Gcc-patches
On Mon, Mar 20, 2023 at 10:05:57PM +, Qing Zhao via Gcc-patches wrote: > My question: is the above section the place in C standard “explicitly allows > contractions”? If not, where it is in C standard? http://port70.net/%7Ensz/c/c99/n1256.html#6.5p8

Re: Should -ffp-contract=off the default on GCC?

2023-03-20 Thread Qing Zhao via Gcc-patches
Hi, > On Mar 16, 2023, at 12:53 PM, Jakub Jelinek wrote: > > On Thu, Mar 16, 2023 at 04:38:41PM +, Qing Zhao via Gcc-patches wrote: >>> NO. We have this debate every few years and such. >> >> So, what’s the major reason we keep the default that is not IEEE754 >> compliant from the

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
> On Mar 16, 2023, at 12:53 PM, Jakub Jelinek wrote: > > On Thu, Mar 16, 2023 at 04:38:41PM +, Qing Zhao via Gcc-patches wrote: >>> NO. We have this debate every few years and such. >> >> So, what’s the major reason we keep the default that is not IEEE754 >> compliant from the

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Jakub Jelinek via Gcc-patches
On Thu, Mar 16, 2023 at 04:38:41PM +, Qing Zhao via Gcc-patches wrote: > > NO. We have this debate every few years and such. > > So, what’s the major reason we keep the default that is not IEEE754 > compliant from the beginning? It is compliant. fusedMultiplyAdd is a standard IEEE 754

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
> On Mar 16, 2023, at 12:31 PM, Andrew Pinski wrote: > > On Thu, Mar 16, 2023 at 9:25 AM Qing Zhao via Gcc-patches > wrote: >> >> Hi, >> >> Recently, we discovered some floating point precision diffs when using GCC8 >> to build our >> application on arm64: After some investigation, it

Re: Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Andrew Pinski via Gcc-patches
On Thu, Mar 16, 2023 at 9:25 AM Qing Zhao via Gcc-patches wrote: > > Hi, > > Recently, we discovered some floating point precision diffs when using GCC8 > to build our > application on arm64: After some investigation, it turns out that this is due > to the > -ffp-contract=fast option that is on

Should -ffp-contract=off the default on GCC?

2023-03-16 Thread Qing Zhao via Gcc-patches
Hi, Recently, we discovered some floating point precision diffs when using GCC8 to build our application on arm64: After some investigation, it turns out that this is due to the -ffp-contract=fast option that is on by default. Therefore, we have to explicitly add -ffp-contract=off and do a