From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A0E513858D32; Mon, 26 Sep 2022 10:53:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A0E513858D32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1664189581; bh=rcq1Wn678qUm5AD+wx0fRFy1z/NribXb1sMRSONTUV4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=OnGKJOrMqmmi4Kx+Zb7ysePZmyvk/jvtVMjgZMmw7LVS27jhQN3peLhmutmmzXxYH 6c7/HcsPoV8dZGHGweWWe+K395T8aWnZ0XssHkvd0iX0OM50eQ/6B8TQXVGtOfLzrU sfqzfR7jC84bAJqQ3G1TeKOm8Dwdh/maAMdgYNLg= From: "rguenth at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/107021] [13 Regression] 511.povray_r error with -Ofast -march=znver2 -flto since r13-2810-gb7fd7fb5011106 Date: Mon, 26 Sep 2022 10:53:00 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: tree-optimization X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: rguenth at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107021 --- Comment #8 from Richard Biener --- (In reply to Martin Li=C5=A1ka from comment #4) > Yep, it exits here: >=20 > #0 __GI_exit (status=3D1) at exit.c:142 > #1 0x00000000002b0961 in povray_exit (i=3D1) at > /home/marxin/Programming/cpu2017/benchspec/CPU/511.povray_r/build/ > build_peak_gcc-m64.0002/povray.cpp:486 > #2 0x00000000002e3ede in pov::Error (format=3D) at > /home/marxin/Programming/cpu2017/benchspec/CPU/511.povray_r/build/ > build_peak_gcc-m64.0002/userio.cpp:365 > #3 0x0000000000270f16 in pov::Parse_Camera (Camera_Ptr=3D= ) at > /home/marxin/Programming/cpu2017/benchspec/CPU/511.povray_r/build/ > build_peak_gcc-m64.0002/parse.cpp:1423 > #4 0x000000000028083f in pov::Parse_Frame () at > /home/marxin/Programming/cpu2017/benchspec/CPU/511.povray_r/build/ > build_peak_gcc-m64.0002/parse.cpp:6125 > #5 0x00000000002c0557 in pov::Parse () at > /home/marxin/Programming/cpu2017/benchspec/CPU/511.povray_r/build/ > build_peak_gcc-m64.0002/parse.cpp:289 >=20 > parse.cpp contains: >=20 > where New->Angle is infinite as assigned here: > 1180 New->Angle =3D HUGE_VAL; >=20 > #if __GNUC_PREREQ (3, 3) > # define HUGE_VAL (__builtin_huge_val ()) > #else And the code that fails is guarded with // apply "angle" if (New->Angle !=3D HUGE_VAL) { if ((New->Type =3D=3D PERSPECTIVE_CAMERA) || (New->= Type =3D=3D ORTHOGRAPHIC_CAMERA)) { if (New->Angle >=3D 180.0) Error("Viewing angle has to be smal= ler than 180 degrees."); so it's somewhat "bad QOI" if we optimize mem =3D Inf; if (mem !=3D Inf) abort (); with -ffinite-math-only because in some way there's no "math" involved here= :P But yeah, the above is just a cheap isinf() which we'd have folded before and now we're folding the literal equality compare as well. Meh. -ffinite-math-only was supposed to give us leverage in associating ops and not wory about turning +Inf into something else, like x + x - x is +Inf if x + x overflows but we like to optimize it to 'x'. That is, it was more relaxing arithmetic folding than saying "any Inf invokes undefined behavior". The docs still say @item -ffinite-math-only @opindex ffinite-math-only Allow optimizations for floating-point arithmetic that assume that arguments and results are not NaNs or +-Infs. blindly breaking programs without benefit isn't really what we should do, but then this ship may have sailed ....=