From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 321CB3830B7A; Wed, 5 Jun 2024 09:30:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 321CB3830B7A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1717579802; bh=FQ+fr19eXMx/ILLKjbP8ChiZ1k7AoVnIu/3uJaUtVOE=; h=From:To:Subject:Date:In-Reply-To:References:From; b=el6WmAR8hy9zmwiZPl6SGrtvVCTIe0v53HJSlo6La3Khih9W+cK2ff55evqH3x/Jv EOP5Ku39xo9pBxxmad5Soow627uMJBcObBuRpVz9E3VSBop+qiJvUZns0mnzNQ7t4N cMVt/ScuvIyK0QlwhS96YdL5nMykv4lWbNPP/ZWc= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/115352] wrong code with _BitInt() __builtin_sub_overflow_p() at -O0 Date: Wed, 05 Jun 2024 09:30:01 +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: 15.0 X-Bugzilla-Keywords: 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: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: component cf_gcctarget bug_status everconfirmed cf_reconfirmed_on cf_gcchost 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=3D115352 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Component|tree-optimization |middle-end Target|x86_64-pc-linux-gnu |x86_64-pc-linux-gnu | |aarch64-linux-gnu Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2024-06-05 Host|x86_64-pc-linux-gnu | --- Comment #1 from Andrew Pinski --- Reducing it down to `128*300` works but `128*400` fails. The gimple level difference between 128*300 vs 128*400 is just the argument that gets passed. So I don't think the bug is __builtin_sub_overflow_p expansion but I could= be wrong. Note clang is very useless at testing this since it unrolls the loop always. (that is after changing __builtin_sub_overflow_p to __builtin_sub_overflow: _BitInt (65) t; return __builtin_sub_overflow (0, b, &t); ) It also fails on aarch64-linux-gnu.=