From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 618163858C32; Sat, 23 Mar 2024 10:19:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 618163858C32 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1711189181; bh=Djfer7GYFKJEq+jYl4+u6g/icwAYRbHEVZnof3Qpexg=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WtrVsxXH3Nz2noiSLG17iUhoIIA/5bAmuodh6I/G1Efq7zSjsYW/gbCDIGKgU0BXK BsOiJl3XlqwKQ0XqyG6/PijsCFZ0TGxOhswGU412hC5KVQCL67gkSueClCEp9h7VfX zG7f4zqwz5VT0j3RreQHP+CbUfwTTrBCjYXpsFX8= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/114425] wrong code with _BitInt() __builtin_add_overflow_p() and __builtin_mul_overflow_p() at -O2 Date: Sat, 23 Mar 2024 10:19:39 +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: 14.0 X-Bugzilla-Keywords: wrong-code X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- 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=3D114425 --- Comment #7 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:f92cf8cbbe199bda70d0dd7893e8c8836777e2d0 commit r14-9640-gf92cf8cbbe199bda70d0dd7893e8c8836777e2d0 Author: Jakub Jelinek Date: Sat Mar 23 11:19:09 2024 +0100 bitint: Handle complex types in build_bitint_stmt_ssa_conflicts [PR1144= 25] The task of the build_bitint_stmt_ssa_conflicts hook for tree-ssa-coalesce.cc next to special casing the multiplication/division/modulo is to ignore statements with large/huge _BitInt lhs which isn't in names bitmap and on the other side pretend all uses of the stmt are used in a later stmt (single user of that SSA_NAME or perhaps single user of lhs of the single user etc.) where the lowering will actually emit the code. Unfortunately the function wasn't handling COMPLEX_TYPE of the large/hu= ge BITINT_TYPE, while the FE doesn't really support such types, they are used under the hood for __builtin_{add,sub,mul}_overflow{,_p}, they are also present or absent from the names bitmap and should be treated the same. Without this patch, the operands of .ADD_OVERFLOW were incorrectly pretended to be used right in that call statement rather than on the cast stmt fr= om IMAGPART_EXPR of .ADD_OVERFLOW return value to some integral type. 2024-03-23 Jakub Jelinek PR tree-optimization/114425 * gimple-lower-bitint.cc (build_bitint_stmt_ssa_conflicts): Han= dle _Complex large/huge _BitInt types like the large/huge _BitInt types. * gcc.dg/torture/bitint-67.c: New test.=