https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114885

--- Comment #2 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Pan Li <pa...@gcc.gnu.org>:

https://gcc.gnu.org/g:add51a2514a39978dc66976a8974f8435c86168f

commit r15-45-gadd51a2514a39978dc66976a8974f8435c86168f
Author: Pan Li <pan2...@intel.com>
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_move):
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 <pan2...@intel.com>

Reply via email to