public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/111832] New: RISC-V: ICE on dynamic LMUL
@ 2023-10-16 12:06 juzhe.zhong at rivai dot ai
  2023-10-18  1:03 ` [Bug target/111832] " cvs-commit at gcc dot gnu.org
  2023-10-18  1:04 ` juzhe.zhong at rivai dot ai
  0 siblings, 2 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-10-16 12:06 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111832
           Summary: RISC-V: ICE on dynamic LMUL
           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: ---

#include <stdint-gcc.h>

#define INDEX16 int16_t

#define TEST_LOOP(DATA_TYPE, BITS)                                            
\
  void __attribute__ ((noinline, noclone))                                    
\
  f_##DATA_TYPE (DATA_TYPE *restrict dest, DATA_TYPE *restrict src,           
\
                 INDEX##BITS *restrict indices, INDEX##BITS *restrict cond)   
\
  {                                                                           
\
    for (int i = 0; i < 128; ++i)                                             
\
      if (cond[i])                                                            
\
        dest[i] += src[indices[i]];                                           
\
  }

#define TEST_ALL(T)                                                           
\
  T (int8_t, 16)                                                              
\

TEST_ALL (TEST_LOOP)

ICE with --param=riscv-autovec-lmul=dynamic

ump file: auto.c.175t.vect
auto.c: In function 'f_int8_t':
auto.c:7:3: internal compiler error: in compute_nregs_for_mode, at
config/riscv/riscv-vector-costs.cc:269
    7 |   f_##DATA_TYPE (DATA_TYPE *restrict dest, DATA_TYPE *restrict src,    
       \
      |   ^~
auto.c:16:3: note: in expansion of macro 'TEST_LOOP'
   16 |   T (int8_t, 16)                                                       
       \
      |   ^
auto.c:18:1: note: in expansion of macro 'TEST_ALL'
   18 | TEST_ALL (TEST_LOOP)
      | ^~~~~~~~
0x1ed4cc0 compute_nregs_for_mode
        ../../../../gcc/gcc/config/riscv/riscv-vector-costs.cc:269
0x1ed4ebc max_number_of_live_regs
        ../../../../gcc/gcc/config/riscv/riscv-vector-costs.cc:304
0x1ed634b riscv_vector::costs::preferred_new_lmul_p(vector_costs const*) const
        ../../../../gcc/gcc/config/riscv/riscv-vector-costs.cc:600
0x1ed658f riscv_vector::costs::better_main_loop_than_p(vector_costs const*)
const
        ../../../../gcc/gcc/config/riscv/riscv-vector-costs.cc:641
0x1bd7658 vect_better_loop_vinfo_p
        ../../../../gcc/gcc/tree-vect-loop.cc:3296
0x1bd7680 vect_joust_loop_vinfos
        ../../../../gcc/gcc/tree-vect-loop.cc:3306
0x1bd8438 vect_analyze_loop(loop*, vec_info_shared*)
        ../../../../gcc/gcc/tree-vect-loop.cc:3518
0x1c4b5dd try_vectorize_loop_1
        ../../../../gcc/gcc/tree-vectorizer.cc:1064
0x1c4baee try_vectorize_loop
        ../../../../gcc/gcc/tree-vectorizer.cc:1182
0x1c4bd9d execute
        ../../../../gcc/gcc/tree-vectorizer.cc:1296


Reference:
https://gcc.godbolt.org/z/e8oEjsa89

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

* [Bug target/111832] RISC-V: ICE on dynamic LMUL
  2023-10-16 12:06 [Bug c/111832] New: RISC-V: ICE on dynamic LMUL juzhe.zhong at rivai dot ai
@ 2023-10-18  1:03 ` cvs-commit at gcc dot gnu.org
  2023-10-18  1:04 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-10-18  1:03 UTC (permalink / raw)
  To: gcc-bugs

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

--- 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:cf7739d4a6ba0b88068877d14439436c22b57630

commit r14-4700-gcf7739d4a6ba0b88068877d14439436c22b57630
Author: Juzhe-Zhong <juzhe.zhong@rivai.ai>
Date:   Tue Oct 17 15:30:39 2023 +0800

    RISC-V: Enable more tests for dynamic LMUL and bug fix[PR111832]

    Last time, Robin has mentioned that dynamic LMUL will cause ICE in SPEC:

    https://gcc.gnu.org/pipermail/gcc-patches/2023-September/629992.html

    which is caused by assertion FAIL.

    When we enable more currents in rvv.exp with dynamic LMUL, such issue can
be
    reproduced and has a PR:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111832

    Now, we enable more tests in rvv.exp in this patch and fix the bug.

            PR target/111832

    gcc/ChangeLog:

            * config/riscv/riscv-vector-costs.cc (get_biggest_mode): New
function.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/rvv.exp: Enable more dynamic tests.

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

* [Bug target/111832] RISC-V: ICE on dynamic LMUL
  2023-10-16 12:06 [Bug c/111832] New: RISC-V: ICE on dynamic LMUL juzhe.zhong at rivai dot ai
  2023-10-18  1:03 ` [Bug target/111832] " cvs-commit at gcc dot gnu.org
@ 2023-10-18  1:04 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2023-10-18  1:04 UTC (permalink / raw)
  To: gcc-bugs

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

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-10-18  1:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-16 12:06 [Bug c/111832] New: RISC-V: ICE on dynamic LMUL juzhe.zhong at rivai dot ai
2023-10-18  1:03 ` [Bug target/111832] " cvs-commit at gcc dot gnu.org
2023-10-18  1:04 ` 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).