From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5150F385840B; Mon, 29 Apr 2024 07:48:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5150F385840B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1714376924; bh=oEBkxDNvZwviQuiMKi74nc9EIR1e9Ca9p18hHWkODFY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=UVvq+XzIkIvvlSV+eTH9Fso4ropk/xR39Cx+lUJp4US3CF+6twH6aD1ZOx9fdc7Hc N7NXfx3+AAmSh0ySEyIGD4f5tJimO1SyQMB561WEksn8NA6vuctkFHk9ojwBiWUsw6 aQEv3sK2LPcL5WdxQZv0wA5R6Lok1p3EO5fS+1O8= 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 07:48:43 +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 #2 from GCC Commits --- The master branch has been updated by Pan Li : https://gcc.gnu.org/g:add51a2514a39978dc66976a8974f8435c86168f commit r15-45-gadd51a2514a39978dc66976a8974f8435c86168f 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 =