From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 21F05395B81B; Fri, 13 May 2022 12:45:47 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 21F05395B81B From: "crazylht at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/105591] [13 Regression] ICE: in tree_to_poly_uint64, at tree.cc:3250 with -O -mavx512f -mno-avx2 since r13-379 Date: Fri, 13 May 2022 12:45:47 +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: 13.0 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: crazylht at gmail dot com 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: 13.0 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 May 2022 12:45:47 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D105591 --- Comment #12 from Hongtao.liu --- (In reply to Jakub Jelinek from comment #11) > Because VEC_PERM_EXPR doesn't require the mask argument to be constant (a= nd > neither does __builtin_shuffle, unlike e.g. __builtin_shufflevector). > If the mask argument remains non-constant until end of compilation, the > modulo N or 2*N needs to be done at runtime (of course unless used hw > instruction performs something like that itself). > And that is the reason why it is defined this way. During compilation th= ere > are way too many spots where a constant could be propagated into a former= ly > non-constant operand of the VEC_PERM_EXPR, and no guarantee that all such > propagations (it isn't in a single spot in a single pass, it is really ma= ny) > will do some extra code to canonicalize it. It can be, but we can't > guarantee it. > For __builtin_shufflevector, we supposedly want to introduce some > VEC_PERM_EXPR variant which would only allow constant mask argument and > which would have different behavior, -1 standing for I don't care rather > than -1 % N or -1 % (2*N). If we introduce something like that, we could > certainly require that the new expr's operand is only -1..N-1 or -1..2*N-1 > and could have then say match.pd that turns a VEC_PERM_EXPR with a consta= nt > argument into the new expr with canonical argument. Makes sense, thanks for the explanation.=