Re: unexpected result with -O2 solved via "volatile"

2021-09-20 Thread David Brown
On 19/09/2021 20:17, Allin Cottrell via Gcc wrote: > Should this perhaps be considered a bug? Below is a minimal test case > for a type of calculation that occurs in my real code. It works as > expected when compiled without optimization, but produces what seems > like a wrong result when compiled

Re: unexpected result with -O2 solved via "volatile"

2021-09-19 Thread Marc Glisse
On Sun, 19 Sep 2021, Allin Cottrell via Gcc wrote: Should this perhaps be considered a bug? Below is a minimal test case for a type of calculation that occurs in my real code. It works as expected when compiled without optimization, but produces what seems like a wrong result when compiled

unexpected result with -O2 solved via "volatile"

2021-09-19 Thread Allin Cottrell via Gcc
Should this perhaps be considered a bug? Below is a minimal test case for a type of calculation that occurs in my real code. It works as expected when compiled without optimization, but produces what seems like a wrong result when compiled with -O2, using both gcc 10.3.1 20210422 on Fedora and