https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98207
Bug ID: 98207 Summary: ARM64 IEEE math results change with -O2 Product: gcc Version: 7.3.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pramsey at cleverelephant dot ca Target Milestone: --- Created attachment 49707 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49707&action=edit Test program temp files built with O0 On the ARM64 platform (in particular testing on an AWS Graviton). Linux ip-172-31-55-124.us-west-2.compute.internal 4.14.203-156.332.amzn2.aarch64 #1 SMP Fri Oct 30 19:19:46 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux A "small" program that carries out only normal arithmetic operations on double returns a different results if g++ is called with -O0 (or with no O at all) and -O2. Attached are dd-o0.ii and dd-o2.ii, the temp file outputs for compiling with -O0 and -O2. On x84_64, g++ compiled code returns the same answer for both O0 and O2. On ARM64 and x84_64, clang++ returns the same answer for both O0 and O2. This test is extracted from a small routine that provides "double double" precision math using only arithmetic operations on IEEE compliant doubles. https://github.com/libgeos/geos/blob/master/src/math/DD.cpp