From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5E4F23857C4C; Wed, 14 Oct 2020 07:19:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5E4F23857C4C From: "rsandifo at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug tree-optimization/97405] ICE in get_or_alloc_expr_for in code hoisting with SVE intrinsics Date: Wed, 14 Oct 2020 07:19:10 +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: 10.2.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: rsandifo at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.2 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: Wed, 14 Oct 2020 07:19:10 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97405 --- Comment #3 from rsandifo at gcc dot gnu.org --- (In reply to Richard Biener from comment #2) > OK, looks like the code expects >=20 > POLY_INT_CST [16, 16] /[ex] 16 >=20 > to be constant folded - looks like poly_int_binop doesn't handle division > nor is there a wi::div_trunc for poly_wide_int. >=20 > This is generated here: >=20 > Breakpoint 5, copy_reference_ops_from_ref (ref=3D,=20 > 891 /* But record element size in units of the type > alignment. */ > 892 temp.op2 =3D TREE_OPERAND (ref, 3); > 893 temp.align =3D eltype->type_common.align; > 894 if (! temp.op2) > 895 temp.op2 =3D size_binop (EXACT_DIV_EXPR, TYPE_SIZE_= UNIT > (eltype), > 896 size_int (TYPE_ALIGN_UNIT > (eltype))); >=20 > Hmm, I see that temp.op2 is indeed always needed unless we want to disrupt > valueization. copy_reference_ops_from_ref also isn't really allowed to f= ail. >=20 > So we absolutely need to be able to fold this EXACT/TRUNC_DIV_EXPR. >=20 > Richard? Yeah, EXACT_DIV_EXPR can't in general be folded at compile time because it wraps differently. We could perhaps fold it if TYPE_OVERFLOW_UNDEFINED is true, but by the letter of the law, we should issue a warning when doing that. I guess we want something similar to bd8a2482569900a114d631f9c38353d3a96a1d= 85 (And it would be nice if we didn't have too many copies of this code. ;-))=