From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7C44B386F82F; Mon, 1 Jun 2020 12:23:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7C44B386F82F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1591014200; bh=HKFTQUlsojXneEy5w4KkZq4N38jI1Lxfc+I5U3/hpMM=; h=From:To:Subject:Date:From; b=xe+vuzyAEYlEuFPGMVV5gQRkpRu1wUz1jhM5C4/BTwCiHtjNcyXOmUAcldTD+jyrw +vYl47R1kFRfmi63NpcWWpbYr59o7EWKxvlArUPR5fKxMV59S1iKMuelR6MpqGedAi Y8ObYm/mU1hEPzjGlOZLSr+XT9VAcXvPkvvH+MXo= From: "felix.yang at huawei dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/95459] New: aarch64: ICE in in aarch64_short_vector_p, at config/aarch64/aarch64.c:16803 Date: Mon, 01 Jun 2020 12:23:20 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: felix.yang at huawei dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone cf_gcctarget Message-ID: 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: Mon, 01 Jun 2020 12:23:20 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D95459 Bug ID: 95459 Summary: aarch64: ICE in in aarch64_short_vector_p, at config/aarch64/aarch64.c:16803 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: unassigned at gcc dot gnu.org Reporter: felix.yang at huawei dot com Target Milestone: --- Target: aarch64 Another sve-related ICE issue triggered under option -mgeneral-regs-only.=20 Reduced test case: #include svint8x2_t callee_s8 (svint8_t x0, svint8_t x1) { return svcreate2 (x0, x1); } $aarch64-linux-gnu-gcc -O2 -S -mgeneral-regs-only -march=3Darmv8.2-a+sve ba= r.c bar.c: In function =E2=80=98callee_s8=E2=80=99: bar.c:6:10: error: ACLE function =E2=80=98svcreate2_s8=E2=80=99 is incompat= ible with the use of =E2=80=98-mgeneral-regs-only=E2=80=99 6 | return svcreate2 (x0, x1); | ^~~~~~~~~ bar.c:4:1: internal compiler error: in aarch64_short_vector_p, at config/aarch64/aarch64.c:16803 4 | callee_s8 (svint8_t x0, svint8_t x1) | ^~~~~~~~~ 0x17d5887 aarch64_short_vector_p ../../gcc-git/gcc/config/aarch64/aarch64.c:16803 0x17d5993 aarch64_composite_type_p ../../gcc-git/gcc/config/aarch64/aarch64.c:16838 0x17d5aab aarch64_vfp_is_call_or_return_candidate ../../gcc-git/gcc/config/aarch64/aarch64.c:16877 0x17b4a07 aarch64_init_cumulative_args(CUMULATIVE_ARGS*, tree_node const*, rtx_def*, tree_node const*, unsigned int, bool) ../../gcc-git/gcc/config/aarch64/aarch64.c:5988 0xdbf60f assign_parms_initialize_all ../../gcc-git/gcc/function.c:2298 0xdc5b8b gimplify_parameters(gimple**) ../../gcc-git/gcc/function.c:3863 0xe86a8b gimplify_body(tree_node*, bool) ../../gcc-git/gcc/gimplify.c:14776 0xe872cf gimplify_function_tree(tree_node*) ../../gcc-git/gcc/gimplify.c:14934 0xbe4a4b cgraph_node::analyze() ../../gcc-git/gcc/cgraphunit.c:671 0xbe70ef analyze_functions ../../gcc-git/gcc/cgraphunit.c:1231 0xbecba3 symbol_table::finalize_compilation_unit() ../../gcc-git/gcc/cgraphunit.c:2975 Here, input param 'type' for aarch64_short_vector_p() looks like: unit-size align:128 warn_if_not_align:0 symtab:0 alias-set -1 canonical-t= ype 0xffffb22300a8 precision:128 min max > constant elt0: elt1: > ... aarch64_short_vector_p() calls aarch64_sve_mode_p() and aarch64_sve_mode_p() depends on TARGET_SVE which is false under option -mgeneral-regs-only. As a result, aarch64_sve_mode_p() returns false and this triggers the ICE. I th= ink we are simply checking whether a type (and a mode) is a 64/128-bit short ve= ctor or not, TARGET_SVE should not make a difference here. Proposed patch is trivial: diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c in= dex 7feff77adf6..4f00a8c2063 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -16800,7 +16800,7 @@ aarch64_short_vector_p (const_tree type, { /* Rely only on the type, not the mode, when processing SVE types. = */ if (type && aarch64_some_values_include_pst_objects_p (type)) - gcc_assert (aarch64_sve_mode_p (mode)); + gcc_assert (TARGET_SVE ? aarch64_sve_mode_p (mode) : true); else size =3D GET_MODE_SIZE (mode); } With this fix, we have: $aarch64-linux-gnu-gcc -O2 -S -mgeneral-regs-only -march=3Darmv8.2-a+sve ba= r.c bar.c: In function =E2=80=98callee_s8=E2=80=99: bar.c:6:10: error: ACLE function =E2=80=98svcreate2_s8=E2=80=99 is incompat= ible with the use of =E2=80=98-mgeneral-regs-only=E2=80=99 6 | return svcreate2 (x0, x1); | ^~~~~~~~~ bar.c:4:1: fatal error: =E2=80=98callee_s8=E2=80=99 requires the SVE ISA ex= tension 4 | callee_s8 (svint8_t x0, svint8_t x1) | ^~~~~~~~~ compilation terminated.=