public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/113420] New: risc-v vector: ICE when using C compiler compile C++ RVV intrinsics
@ 2024-01-16 11:23 juzhe.zhong at rivai dot ai
  2024-01-22  6:48 ` [Bug target/113420] " cvs-commit at gcc dot gnu.org
  2024-01-22  7:12 ` juzhe.zhong at rivai dot ai
  0 siblings, 2 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2024-01-16 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 113420
           Summary: risc-v vector: ICE when using C compiler compile C++
                    RVV intrinsics
           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 <riscv_vector.h>

void matrix_transpose_intrinsics(float *dst, float *src, size_t n) 
{
    for (size_t row_id = 0; row_id < n; ++row_id) { // input row-index
        size_t avl = n;
        // source pointer to row_id-th row
        float* row_src = src + row_id * n;
        // destination pointer to row_id-th column
        float* row_dst = dst + row_id;
        while (avl > 0) {
            size_t vl = __riscv_vsetvl_e32m1(avl);
            vfloat32m1_t row = __riscv_vle32_v_f32m1(row_src, vl);
            __riscv_vsse32(row_dst, sizeof(float) * n, row, vl);
            // updating application vector length
            avl -= vl;
            // updating source and destination pointers
            row_src += vl;
            row_dst += vl * n;
        }
    }
}

<source>: In function 'matrix_transpose_intrinsics':
<source>:14:13: internal compiler error: in resolve_overloaded_builtin, at
config/riscv/riscv-vector-builtins.cc:4614
   14 |             __riscv_vsse32(row_dst, sizeof(float) * n, row, vl);
      |             ^~~~~~~~~~~~~~
0x7fbb66a29e3f __libc_start_main
        ???:0
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

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

* [Bug target/113420] risc-v vector: ICE when using C compiler compile C++ RVV intrinsics
  2024-01-16 11:23 [Bug c/113420] New: risc-v vector: ICE when using C compiler compile C++ RVV intrinsics juzhe.zhong at rivai dot ai
@ 2024-01-22  6:48 ` cvs-commit at gcc dot gnu.org
  2024-01-22  7:12 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-01-22  6:48 UTC (permalink / raw)
  To: gcc-bugs

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

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

https://gcc.gnu.org/g:46a664dd59ec6c1121914d6857d6edb94501c517

commit r14-8328-g46a664dd59ec6c1121914d6857d6edb94501c517
Author: xuli <xuli1@eswincomputing.com>
Date:   Mon Jan 22 06:41:49 2024 +0000

    RISC-V: Bugfix for resolve_overloaded_builtin[PR113420]

    v2:
    Avoid internal ICE for the case below.
    vint8mf8_t test_vle8_v_i8mf8_m(vbool64_t vm, const int32_t *rs1, size_t vl)
{
      return __riscv_vle8(vm, rs1, vl);
    }

    v1:
    Change the hash value of overloaded intrinsic from considering
    all parameter types to:
    1. Encoding vector data type
    2. In order to distinguish vle8_v_i8mf8_m(vbool64_t vm, const int8_t *rs1,
size_t vl)
       and vle8_v_u8mf8_m(vbool64_t vm, const uint8_t *rs1, size_t vl), encode
the pointer type
    3. In order to distinguish vfadd_vv_f32mf2_rm(vfloat32mf2_t vs2,
vfloat32mf2_t vs1, size_t vl)
       and vfadd_vv_f32mf2(vfloat32mf2_t vs2, vfloat32mf2_t vs1, size_t vl),
encode the number of
       parameters. The same goes for the vxrm intrinsics.

            PR target/113420

    gcc/ChangeLog:

            * config/riscv/riscv-vector-builtins.cc (has_vxrm_or_frm_p):remove.
            (registered_function::overloaded_hash):refactor.
            (resolve_overloaded_builtin):avoid internal ICE.

    gcc/testsuite/ChangeLog:

            * gcc.target/riscv/rvv/base/pr113420-1.c: New test.
            * gcc.target/riscv/rvv/base/pr113420-2.c: New test.

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

* [Bug target/113420] risc-v vector: ICE when using C compiler compile C++ RVV intrinsics
  2024-01-16 11:23 [Bug c/113420] New: risc-v vector: ICE when using C compiler compile C++ RVV intrinsics juzhe.zhong at rivai dot ai
  2024-01-22  6:48 ` [Bug target/113420] " cvs-commit at gcc dot gnu.org
@ 2024-01-22  7:12 ` juzhe.zhong at rivai dot ai
  1 sibling, 0 replies; 3+ messages in thread
From: juzhe.zhong at rivai dot ai @ 2024-01-22  7:12 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- 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:[~2024-01-22  7:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-16 11:23 [Bug c/113420] New: risc-v vector: ICE when using C compiler compile C++ RVV intrinsics juzhe.zhong at rivai dot ai
2024-01-22  6:48 ` [Bug target/113420] " cvs-commit at gcc dot gnu.org
2024-01-22  7:12 ` 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).