[Bug target/99621] [8/9/10/11 Regression] Wrong code with -m32 -O1 -fcaller-saves -fexpensive-optimizations since g:058e97ecf33ad0dfd926b3876a4bcf59ac9556ff

williambader at hotmail dot com gcc-bugzilla@gcc.gnu.org
Wed Mar 17 10:23:58 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99621

--- Comment #24 from William Bader <williambader at hotmail dot com> ---
Jakub was right. I didn't understand what he meant at first. Sorry about that.

I can confirm `gcc -m32 -O9 -fexcess-precision=standard gcc-bug1-init.c` on the
original example works correctly for me.

If I change line 758 (the line after #if BUG_FIX) from
  if (new_qxd4_y == cur_qxd4_y && new_qxd4_x > cur_qxd4_x) {
to
  if (new_qxd4_y >= cur_qxd4_y - 0.001 && new_qxd4_y <= cur_qxd4_y + 0.001 &&
new_qxd4_x > cur_qxd4_x) {

then it also works.

Years ago I did scientific programming in fortran, and I should have remembered
from that never to compare two real numbers for equality.


More information about the Gcc-bugs mailing list