From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 64AF43858C3A; Thu, 1 Feb 2024 18:30:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64AF43858C3A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706812225; bh=Ux0oMelYCy6rOINVUH2eg22P6u1C51T4Eys+QI/b/9Y=; h=From:To:Subject:Date:From; b=Mniwu1B4dDchENr/VK9zXuoiuOz41jjCxcs230yoLKuYGgOIH3t/qVbJsQr2E3GPi emggh3sjuQNIQkf9n6Z2ghyoGPxd34r16MOC0860isl5atDBeuHkOBIx9X0PQ+p8JO KFGqZNdr2wodNjvYC+Jd4lI3s78eEVtajByBuC0U= From: "jiajing_zheng at 163 dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/113709] New: User -fno-thread-jumps gave Floating point exception at -O2, -O3, -Os Date: Thu, 01 Feb 2024 18:30:24 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 12.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: jiajing_zheng at 163 dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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=3D113709 Bug ID: 113709 Summary: User -fno-thread-jumps gave Floating point exception at -O2, -O3, -Os Product: gcc Version: 12.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jiajing_zheng at 163 dot com Target Milestone: --- With -fno-thread-jumps option, GCC-12.2.0 at -O2, O3, -Os optimization leve= ls generated the 'Floating point exception (core dumped)' message. jing@jing-ubuntu:~$ cat source.c=20 static unsigned int A =3D 20; static unsigned int B =3D 1; int main(void) { int i; for (i =3D 0; i < 2; i++) { A *=3D (B / (A ? A : 3)) / (A ? A : 5); } return 0; } jing@jing-ubuntu:~$ gcc source.c -O0 -fno-thread-jumps && ./a.out jing@jing-ubuntu:~$ gcc source.c -O1 -fno-thread-jumps && ./a.out jing@jing-ubuntu:~$ gcc source.c -O2 -fno-thread-jumps && ./a.out Floating point exception (core dumped) jing@jing-ubuntu:~$ gcc source.c -O3 -fno-thread-jumps && ./a.out Floating point exception (core dumped) jing@jing-ubuntu:~$ gcc source.c -Os -fno-thread-jumps && ./a.out Floating point exception (core dumped) jing@jing-ubuntu:~$ gcc -v Using built-in specs. COLLECT_GCC=3Dgcc COLLECT_LTO_WRAPPER=3D/home/jing/gcc-12.2.0/usr/local/bin/../libexec/gcc/x8= 6_64-pc-linux-gnu/12.2.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure -enable-checking=3Drelease -enable-languages= =3Dc,c++ -disable-multilib Thread model: posix Supported LTO compression algorithms: zlib gcc version 12.2.0 (GCC)=