public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111590] New: RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled
@ 2023-09-25 11:49 juzhe.zhong at rivai dot ai
  2023-09-27  8:28 ` [Bug target/111590] " cvs-commit at gcc dot gnu.org
  2023-09-27  8:29 ` juzhe.zhong at rivai dot ai
  0 siblings, 2 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-09-25 11:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111590
           Summary: RISC-V: Multiple ICE in gfortran regression with 'V'
                    Extension enabled
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: juzhe.zhong at rivai dot ai
  Target Milestone: ---

FAIL: gfortran.dg/assumed_rank_24.f90   -O2  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/assumed_rank_24.f90   -O2  (test for excess errors)
FAIL: gfortran.dg/assumed_rank_24.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/assumed_rank_24.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/assumed_rank_24.f90   -O3 -g  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/assumed_rank_24.f90   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/class_to_type_1.f03   -O2  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/class_to_type_1.f03   -O2  (test for excess errors)
FAIL: gfortran.dg/class_to_type_1.f03   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/class_to_type_1.f03   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/class_to_type_1.f03   -O3 -g  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/class_to_type_1.f03   -O3 -g  (test for excess errors)
FAIL: gfortran.dg/class_array_4.f03   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  execution test
FAIL: gfortran.dg/cshift_bounds_4.f90   -O2  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/cshift_bounds_4.f90   -O2  (test for excess errors)
FAIL: gfortran.dg/cshift_bounds_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/cshift_bounds_4.f90   -O3 -fomit-frame-pointer -funroll-loops
-fpeel-loops -ftracer -finline-functions  (test for excess errors)
FAIL: gfortran.dg/cshift_bounds_4.f90   -O3 -g  (internal compiler error: in
smallest_mode_for_size, at stor-layout.cc:356)
FAIL: gfortran.dg/cshift_bounds_4.f90   -O3 -g  (test for excess errors)

One of the case:

program main
  integer, dimension(:,:), allocatable :: a, b
  integer, dimension(:), allocatable :: sh
  allocate (a(2,2))
  allocate (b(2,2))
  allocate (sh(3))
  a = 1
  b = cshift(a,sh)
end program main

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

* [Bug target/111590] RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled
  2023-09-25 11:49 [Bug c/111590] New: RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled juzhe.zhong at rivai dot ai
@ 2023-09-27  8:28 ` cvs-commit at gcc dot gnu.org
  2023-09-27  8:29 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-09-27  8:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS 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:073849da3dfd5cabbfd4492a40a17b207b4a7630

commit r14-4291-g073849da3dfd5cabbfd4492a40a17b207b4a7630
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Wed Sep 27 06:47:12 2023 +0800

    DSE: Fix ICE when the mode with access_size don't exist on the
target[PR111590]

    hen doing fortran test with 'V' extension enabled on RISC-V port.
    I saw multiple ICE: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111590

    The root cause is on DSE:

    internal compiler error: in smallest_mode_for_size, at stor-layout.cc:356
    0x1918f70 smallest_mode_for_size(poly_int<2u, unsigned long>, mode_class)
            ../../../../gcc/gcc/stor-layout.cc:356
    0x11f75bb smallest_int_mode_for_size(poly_int<2u, unsigned long>)
            ../../../../gcc/gcc/machmode.h:916
    0x3304141 find_shift_sequence
            ../../../../gcc/gcc/dse.cc:1738
    0x3304f1a get_stored_val
            ../../../../gcc/gcc/dse.cc:1906
    0x3305377 replace_read
            ../../../../gcc/gcc/dse.cc:2010
    0x3306226 check_mem_read_rtx
            ../../../../gcc/gcc/dse.cc:2310
    0x330667b check_mem_read_use
            ../../../../gcc/gcc/dse.cc:2415

    After investigations, DSE is trying to do optimization like this following
codes:

    (insn 86 85 87 9 (set (reg:V4DI 168)
            (mem/u/c:V4DI (reg/f:DI 171) [0  S32 A128])) "bug.f90":6:18 discrim
6 1167 {*movv4di}
         (expr_list:REG_EQUAL (const_vector:V4DI [
                    (const_int 4 [0x4])
                    (const_int 1 [0x1]) repeated x2
                    (const_int 3 [0x3])
                ])
            (nil)))

    (set (mem) (reg:V4DI 168))

    Then it ICE on: auto new_mode = smallest_int_mode_for_size (access_size *
BITS_PER_UNIT);

    The access_size may be 24 or 32. We don't have such integer modes with
these size so it ICE.

    TODO: The better way maybe make DSE use native_encode_rtx/native_decode_rtx
          but I don't know how to do that.  So let's quickly fix this issue, we
          can improve the fix later.

            PR target/111590

    gcc/ChangeLog:

            * dse.cc (find_shift_sequence): Check the mode with access_size
exist on the target.

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

* [Bug target/111590] RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled
  2023-09-25 11:49 [Bug c/111590] New: RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled juzhe.zhong at rivai dot ai
  2023-09-27  8:28 ` [Bug target/111590] " cvs-commit at gcc dot gnu.org
@ 2023-09-27  8:29 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-09-27  8:29 UTC (permalink / raw)
  To: gcc-bugs

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

JuzheZhong <juzhe.zhong at rivai dot ai> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from JuzheZhong <juzhe.zhong at rivai dot ai> ---
fixed

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

end of thread, other threads:[~2023-09-27  8:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-25 11:49 [Bug c/111590] New: RISC-V: Multiple ICE in gfortran regression with 'V' Extension enabled juzhe.zhong at rivai dot ai
2023-09-27  8:28 ` [Bug target/111590] " cvs-commit at gcc dot gnu.org
2023-09-27  8:29 ` juzhe.zhong at rivai dot ai

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).