public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran
@ 2024-04-29  6:43 pan2.li at intel dot com
  2024-04-29  6:45 ` [Bug c/114885] " kito at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pan2.li at intel dot com @ 2024-04-29  6:43 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114885
           Summary: RISC-V: ICE of unrecog insn when graphite for both the
                    c/c++ and fortran
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pan2.li at intel dot com
  Target Milestone: ---

When some graphite (require the isl build for gcc) tests, there are sorts of
ICE that cannot recog the insn.

FAIL: gcc.dg/graphite/pr111878.c (internal compiler error: in 
extract_insn, at recog.cc:2812)

FAIL: gfortran.dg/graphite/id-27.f90   -O  (internal compiler error: in 
extract_insn, at recog.cc:2812)
FAIL: gfortran.dg/graphite/id-27.f90   -O  (test for excess errors)
FAIL: gfortran.dg/graphite/pr14741.f90   -O  (internal compiler error: 
in extract_insn, at recog.cc:2812)
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  (internal 
compiler error: in extract_insn, at recog.cc:2812)
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/pr29581.f90   -O3 -g  (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/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/pr29832.f90   -O3 -fomit-frame-pointer 
-funroll-loops -fpeel-loops -ftracer -finline-functions  (test for 
excess errors)
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/vect-pr40979.f90   -O  (internal compiler 
error: in extract_insn, at recog.cc:2812)
FAIL: gfortran.dg/graphite/vect-pr40979.f90   -O  (test for excess errors)

Reproduce step(s):

1. download isl-0.24, let isl -> /some-where/riscv-gnu-toolchain/gcc/isl-0.24

2. mkdir __BUILD__ && cd __BUILD__ && ../configure \
  --target=riscv64-unknown-elf \
  --prefix=${INSTALL_DIR} \
  --disable-shared \
  --enable-threads \
  --enable-tls \
  --enable-languages=c,c++,fortran \
  --with-system-zlib \
  --with-newlib \
  --disable-libmudflap \
  --disable-libssp \
  --disable-libquadmath \
  --disable-libgomp \
  --enable-nls \
  --disable-tm-clone-registry \
  --src=`pwd`/../ \
  --with-abi=lp64d \
  --with-arch=rv64gcv \
  --with-tune=rocket \
  --with-isa-spec=20191213 \
  CFLAGS_FOR_BUILD="-O0 -g" \
  CXXFLAGS_FOR_BUILD="-O0 -g" \
  CFLAGS_FOR_TARGET="-O0  -g" \
  CXXFLAGS_FOR_TARGET="-O0 -g" \
  BOOT_CFLAGS="-O0 -g" \
  CFLAGS="-O0 -g" \
  CXXFLAGS="-O0 -g" \
  GM2FLAGS_FOR_TARGET="-O0 -g" \
  GOCFLAGS_FOR_TARGET="-O0 -g" \
  GDCFLAGS_FOR_TARGET="-O0 -g"
make -j $(nproc) all-gcc && make install-gcc

3. ../__RISC-V_INSTALL___RV64/bin/riscv64-unknown-elf-gcc
gcc/testsuite/gcc.dg/graphite/pr111878.c -O3 -fgraphite-identity
-fsave-optimization-record -march=rv64gcv -mabi=lp64d -c -S -o -

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c/114885] RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran
  2024-04-29  6:43 [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran pan2.li at intel dot com
@ 2024-04-29  6:45 ` kito at gcc dot gnu.org
  2024-04-29  7:48 ` [Bug target/114885] " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: kito at gcc dot gnu.org @ 2024-04-29  6:45 UTC (permalink / raw)
  To: gcc-bugs

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

Kito Cheng <kito at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |kito at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2024-04-29

--- Comment #1 from Kito Cheng <kito at gcc dot gnu.org> ---
I can reproduce on my side

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/114885] RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran
  2024-04-29  6:43 [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran pan2.li at intel dot com
  2024-04-29  6:45 ` [Bug c/114885] " kito at gcc dot gnu.org
@ 2024-04-29  7:48 ` cvs-commit at gcc dot gnu.org
  2024-04-29  8:31 ` cvs-commit at gcc dot gnu.org
  2024-04-29 15:12 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-29  7:48 UTC (permalink / raw)
  To: gcc-bugs

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 <panli@gcc.gnu.org>:

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

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/114885] RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran
  2024-04-29  6:43 [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran pan2.li at intel dot com
  2024-04-29  6:45 ` [Bug c/114885] " kito at gcc dot gnu.org
  2024-04-29  7:48 ` [Bug target/114885] " cvs-commit at gcc dot gnu.org
@ 2024-04-29  8:31 ` cvs-commit at gcc dot gnu.org
  2024-04-29 15:12 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-04-29  8:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Pan Li <panli@gcc.gnu.org>:

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

commit r14-10145-gd40073be96ea24c7eace7141c4e0fed50077d2b0
Author: Pan Li <pan2.li@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.li@intel.com>
    (cherry picked from commit 25213c4c11aa96aff1beda2aa4471cdff29e8953)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug target/114885] RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran
  2024-04-29  6:43 [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran pan2.li at intel dot com
                   ` (2 preceding siblings ...)
  2024-04-29  8:31 ` cvs-commit at gcc dot gnu.org
@ 2024-04-29 15:12 ` law at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: law at gcc dot gnu.org @ 2024-04-29 15:12 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED
                 CC|                            |law at gcc dot gnu.org

--- Comment #4 from Jeffrey A. Law <law at gcc dot gnu.org> ---
Should be fixed on gcc-14 branch and on the trunk.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-29 15:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29  6:43 [Bug c/114885] New: RISC-V: ICE of unrecog insn when graphite for both the c/c++ and fortran pan2.li at intel dot com
2024-04-29  6:45 ` [Bug c/114885] " kito at gcc dot gnu.org
2024-04-29  7:48 ` [Bug target/114885] " cvs-commit at gcc dot gnu.org
2024-04-29  8:31 ` cvs-commit at gcc dot gnu.org
2024-04-29 15:12 ` law at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).