From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 20AD63858D33; Mon, 29 Apr 2024 08:31:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 20AD63858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714379488; bh=se08O+abV2ZsppfR5d/KzbfYkiroGtakleIgsLXYYrs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Jg2Uoyyzs+Nk1TE2ssCR1fNieY/9ptdWZg9lR9Q9ad8QbWxz8WhRq/fPrEfCkNvKo J9cQkV+pf3WAEuTIs+G9qU2YOM+iHwXX4+vVy1mUpL/wqZjnUeUNpJmcD0ei9kBZAG 0OGyvGGhj81yu8cBmjZWbKp94C8nIchcCkz1zhHs= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/114885] RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran Date: Mon, 29 Apr 2024 08:31:27 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target 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: NEW 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: 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=3D114885 --- Comment #3 from GCC Commits --- The releases/gcc-14 branch has been updated by Pan Li : https://gcc.gnu.org/g:d40073be96ea24c7eace7141c4e0fed50077d2b0 commit r14-10145-gd40073be96ea24c7eace7141c4e0fed50077d2b0 Author: Pan Li Date: Sat Apr 27 20:24:04 2024 +0800 RISC-V: Fix ICE for legitimize move on subreg const_poly_int [PR114885] When we build with isl, there will be a ICE for graphite in both the c/c++ and fortran. The legitimize move cannot take care of below rtl. (set (subreg:DI (reg:TI 237) 8) (subreg:DI (const_poly_int:TI [4, 2]) 8= )) Then we will have ice similar to below: internal compiler error: in extract_insn, at recog.cc:2812. This patch would like to take care of the above rtl. Given the value of const_poly_int can hardly excceed the max of int64, we can simply consider the highest 8 bytes of TImode is zero and then set the dest to (const_int 0). The below test cases are fixed by this PATCH. C: FAIL: gcc.dg/graphite/pr111878.c (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gcc.dg/graphite/pr111878.c (test for excess errors) Fortran: FAIL: gfortran.dg/graphite/vect-pr40979.f90 -O (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr29832.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr29581.f90 -O3 -g (test for excess errors) FAIL: gfortran.dg/graphite/pr14741.f90 -O (test for excess errors) FAIL: gfortran.dg/graphite/pr29581.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: gfortran.dg/graphite/vect-pr40979.f90 -O (test for excess errors) FAIL: gfortran.dg/graphite/id-27.f90 -O (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr29832.f90 -O3 -g (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr29832.f90 -O3 -g (test for excess errors) FAIL: gfortran.dg/graphite/id-27.f90 -O (test for excess errors) FAIL: gfortran.dg/graphite/pr29832.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) FAIL: gfortran.dg/graphite/pr29581.f90 -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr14741.f90 -O (internal compiler error: in extract_insn, at recog.cc:2812) FAIL: gfortran.dg/graphite/pr29581.f90 -O3 -g (internal compiler error: in extract_insn, at recog.cc:2812) The below test suites are passed for this patch: * The rv64gcv fully regression test. * The rv64gc fully regression test. Try to write some RTL code for test but not works well according to existing test cases. Thus, take above as test cases. Please note graphite require the gcc build with isl. PR target/114885 gcc/ChangeLog: * config/riscv/riscv.cc (riscv_legitimize_subreg_const_poly_mov= e): New func impl to take care of (const_int_poly:TI 8). (riscv_legitimize_move): Handle subreg is const_int_poly, Signed-off-by: Pan Li (cherry picked from commit 25213c4c11aa96aff1beda2aa4471cdff29e8953)=