From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0DE17385842F; Fri, 9 Feb 2024 15:17:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0DE17385842F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1707491866; bh=Ga8KDvjUhF9b+S02JkFyGDnCB2icN5qexEYlKIw4dwM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=KPjqE4vdueo/IINaRS9XMj8xvee7GWPByksNeZys1gR19PuSqIdXaFASzL0cJ8gnj xG+33PDvz/qnfGEsj4N4phs20X6BUlFDgSGyo+nHvSMFuh5uAgduXKe+KbJJgdaYMt vRp6r/R83wPfEJaRDW9q3GLuI0s1NtHF/FYoYaEM= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/113783] ICE: in lower_stmt, at gimple-lower-bitint.cc:5455 with -O -mavx512f and _BitInt() in memcpy() Date: Fri, 09 Feb 2024 15:17:45 +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: 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=3D113783 --- Comment #4 from GCC Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:c9bdcb0c3433ce09f5bb713a51a14130858578a2 commit r14-8899-gc9bdcb0c3433ce09f5bb713a51a14130858578a2 Author: Jakub Jelinek Date: Fri Feb 9 16:17:08 2024 +0100 lower-bitint: Fix handling of VIEW_CONVERT_EXPRs to minimally supported huge INTEGER_TYPEs [PR113783] On the following testcases memcpy lowering folds the calls to reading and writing of MEM_REFs with huge INTEGER_TYPEs - uint256_t with OImode or uint512_t with XImode. Further optimization turn the load from MEM_REF from the large/huge _BitInt var into VIEW_CONVERT_EXPR from it to the uint256_t/uint512_t. The backend doesn't really support those except for "movoi"/"movxi" insns, so it isn't possible to handle it like casts to supportable INTEGER_TYPEs where we can construct those from individual limbs - there are no OImode/XImode shif= ts and the like we can use. So, the following patch makes sure for such VCEs that the SSA_NAME oper= and of the VCE lives in memory and then turns it into a VIEW_CONVERT_EXPR so that we actually load the OImode/XImode integer from memory (i.e. a mov= ). We need to make sure those aren't merged with other operations in the gimple_lower_bitint hunks. For SSA_NAMEs which have underlying VAR_DECLs that is all we need, those VAR_DECL have ARRAY_TYPEs. For SSA_NAMEs which have underlying PARM_DECLs or RESULT_DECLs those ha= ve BITINT_TYPE and I had to tweak expand_expr_real_1 for that so that it doesn't try convert_modes on those when one of the modes is BLKmode - we want to fall through into the adjust_address on the MEM. 2024-02-09 Jakub Jelinek PR tree-optimization/113783 * gimple-lower-bitint.cc (bitint_large_huge::lower_stmt): Look through VIEW_CONVERT_EXPR for final cast checks. Handle VIEW_CONVERT_EXPRs from large/huge _BitInt to > MAX_FIXED_MODE_= SIZE INTEGER_TYPEs. (gimple_lower_bitint): Don't merge mergeable operations or other casts with VIEW_CONVERT_EXPRs to > MAX_FIXED_MODE_SIZE INTEGER_TYPEs. * expr.cc (expand_expr_real_1): Don't use convert_modes if eith= er mode is BLKmode. * gcc.dg/bitint-88.c: New test.=