From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BC1C83858D33; Tue, 10 Jan 2023 23:15:15 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BC1C83858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1673392515; bh=LzHXXwPJEFAWMcg8RYIFoutBYFExQYIGpMx98YQoWrc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NkAzlBbS58eWuDEXfysqT5kUXS+A8WAXieeMQaVH0cbxHLvPBIR4xfFxNmsWA7kpr ByjC2BTnar/HWFfp6pUeKzfdXtrsZam8YJjEVGl99xgi3YyKS9FKUpoRN3uS55uzE7 lK3OZdgQzprU3AJh2+kl3kX5iknM+CHnQen1mYrk= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/108365] [9/10/11/12/13 Regression] Wrong code with -O0 Date: Tue, 10 Jan 2023 23:15:15 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic, wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia 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: 10.5 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cf_known_to_work cf_known_to_fail 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=3D108365 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Known to work|6.1.0, 6.4.0 | Known to fail| |6.1.0, 6.4.0 --- Comment #3 from Andrew Pinski --- (In reply to Jakub Jelinek from comment #2) > It is UB on ilp32, but for lp64 it should be well defined. > Started with r9-1730-g9e392989053729d4d50 Then there is an older bug. For the following C++ code: constexpr char b =3D 1; long t =3D (short) ((long long) (unsigned long long) (-__INT_MAX__ - 1) / (= long long) (b ? -1 : 0)); Should not produce any warnings but does, all the way back to GCC 6.1.0.=