From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id ECF8A3858D33; Tue, 10 Jan 2023 22:47:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org ECF8A3858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673390845; bh=ex74wqpaPu/pVIAJQr4Ma46pNdk2ZweE1HSu7ECjjws=; h=From:To:Subject:Date:From; b=sIP37dAznnGsaQ/WM+ySVH/d6tRnh7j4c6oE4z34EQsWYe3dbYE3bNbcvyNnLthPP jZ+zLsGRLUJC0RUvNtO9oNpLxXSQUcxwOxfBzZ8BebBXQ+6iIzTjUPEExyZyiZ8056 S2dy85gwtQ0F9ehKtkKbVash8t5BeiENWxOLoQzM= From: "vsevolod.livinskiy at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/108365] New: [9/10/11/12/13 Regression] Wrong code with -O0 Date: Tue, 10 Jan 2023 22:47:25 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new 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: vsevolod.livinskiy at gmail 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=3D108365 Bug ID: 108365 Summary: [9/10/11/12/13 Regression] Wrong code with -O0 Product: gcc Version: 13.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: vsevolod.livinskiy at gmail dot com Target Milestone: --- Link to the Compiler Explorer: https://godbolt.org/z/rMaofso7E Reproducer: char b[23] =3D {1}; int main() { for (;short(long((unsigned long)(-2147483647 - 1)) / long(b[0] ? -1 : 0));); } Error: >$ g++ -O0 repr.cpp && ./a.out=20 Floating point exception (core dumped) gcc version 13.0.0 20230110 (e9a39ad7936815980013605b052b12425d56ead8)=