From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 047773888C68; Thu, 20 Jun 2024 08:27:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 047773888C68 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1718872058; bh=JWkgiisKm9HQe2Ur49v4mum8CqrwC6e8u9SGGHcWLn4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KnxJ3HejLim8MeoDAOoOSOfIb7VNMRvQbOrUR/6SDa1H9St4fVMwDnvfuVXd8HZ3j kE3ry7+NcXAaPyErMFBcnrgrxEbAjbc0iDyGrKZHfY2AwQNelkTomYfYS5U1IEB47Y U8YujLC1iEV4GHZLkkTQyqQr86fjfZaMkAJ7NthY= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/115544] ICE: in lower_complexexpr_stmt, at gimple-lower-bitint.cc:4719 with -O -fno-tree-fre -fno-tree-ccp -fno-tree-forwprop and _BitInt() __builtin_mul_overflow() Date: Thu, 20 Jun 2024 08:27:35 +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: 15.0 X-Bugzilla-Keywords: ice-on-valid-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=3D115544 --- Comment #6 from GCC Commits --- The releases/gcc-14 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:f79e909a11672f2c5b04239d8d9376b900c5b295 commit r14-10327-gf79e909a11672f2c5b04239d8d9376b900c5b295 Author: Jakub Jelinek Date: Wed Jun 19 21:10:39 2024 +0200 bitint: Fix up lowering of COMPLEX_EXPR [PR115544] We don't really support _Complex _BitInt(N), the only place we use bitint complex types is for the .{ADD,SUB,MUL}_OVERFLOW internal functi= on results and COMPLEX_EXPR in the usual case should be either not present yet because the ifns weren't folded and will be lowered, or optimized into something simpler, because normally the complex bitint should be used just for extracting the 2 subparts from it. Still, with disabled optimizations it can occassionally happen that it appears in the IL and that is why there is support for lowering those, but it doesn't handle optimizing those too much, so if it uses SSA_NAME, it relies on them having a backing VAR_DECL during the lowering. This is normally achieves through the && ((is_gimple_assign (use_stmt) && (gimple_assign_rhs_code (use_stmt) !=3D COMPLEX_EXPR)) || gimple_code (use_stmt) =3D=3D GIMPLE_COND) hunk in gimple_lower_bitint, but as the following testcase shows, there is one thing I've missed, the load optimization isn't guarded by the above stuff. So, either we'd need to add support for loads to lower_complexexpr_stmt, or because they should be really rare, this patch just disables the load optimization if at least one load use is a COMPLEX_EXPR (like we do already for PHIs, calls, asm). 2024-06-19 Jakub Jelinek PR tree-optimization/115544 * gimple-lower-bitint.cc (gimple_lower_bitint): Disable optimiz= ing loads used by COMPLEX_EXPR operands. * gcc.dg/bitint-107.c: New test. (cherry picked from commit 25860fd2a674373a6476af5ff0bd92354fc53d06)=