From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D5C233858404; Tue, 10 Oct 2023 11:41:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D5C233858404 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1696938115; bh=viGZvxnn+SpHttqM/VANEFI45xfUSJaL3/CB7pXTX94=; h=From:To:Subject:Date:In-Reply-To:References:From; b=X46HHOyik2gcqBgdpe5e/5C/Ma4hSXQ0XilzvWXt2Dtj6DAc6IeZEuQPM9hBnwlXz smdltZ5Zo9QfT6Xdr17XRz8hALcYpKgZhpFPBYWc3F3qRwZX+iYitnhQOFYWjqhG0H c0jk1lSPS4Aw8hCXpkVHP1Pad4vLLqiMsV7Oz7ZA= From: "prathamesh3492 at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug middle-end/111754] [14 Regression] ICE: in decompose, at rtl.h:2313 at -O Date: Tue, 10 Oct 2023 11:41:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: middle-end X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: ice-on-valid-code, needs-bisection X-Bugzilla-Severity: normal X-Bugzilla-Who: prathamesh3492 at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: prathamesh3492 at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111754 --- Comment #3 from prathamesh3492 at gcc dot gnu.org --- The issue is that we only support integral vector types in fold_vec_perm_cs= t, but fail to check for the same before calling it from fold_vec_perm. The following tweak fixes the ICE: diff --git a/gcc/fold-const.cc b/gcc/fold-const.cc index 4f8561509ff..a29a8af6d2f 100644 --- a/gcc/fold-const.cc +++ b/gcc/fold-const.cc @@ -10801,7 +10801,8 @@ fold_vec_perm (tree type, tree arg0, tree arg1, con= st vec_perm_indices &sel) return NULL_TREE; if (TREE_CODE (arg0) =3D=3D VECTOR_CST - && TREE_CODE (arg1) =3D=3D VECTOR_CST) + && TREE_CODE (arg1) =3D=3D VECTOR_CST + && INTEGRAL_TYPE_P (TREE_TYPE (type))) return fold_vec_perm_cst (type, arg0, arg1, sel); /* For fall back case, we want to ensure we have VLS vectors and results in the following .optimized dump: F bar (F a, F b) { F c; [local count: 1073741824]: c_2 =3D VEC_PERM_EXPR ; __builtin_logbl (0.0); return c_2; } F foo () { [local count: 1073741824]: __builtin_logbl (0.0); return { 0.0, 9.0e+0, 0.0, 0.0 }; }=