public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "julienpommier at free dot fr" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c/111935] New: gcc ICE with risc-v vector intrinsics
Date: Mon, 23 Oct 2023 12:52:49 +0000	[thread overview]
Message-ID: <bug-111935-4@http.gcc.gnu.org/bugzilla/> (raw)

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

            Bug ID: 111935
           Summary: gcc ICE with risc-v vector intrinsics
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: julienpommier at free dot fr
  Target Milestone: ---

The following code (test.c) crashes the riscv gcc 13.2.0 compiler of ubuntu
23.10:

#include <riscv_vector.h>

inline vuint32m4_t __attribute__((__always_inline__)) transpose_indexes() {
  static const uint32_t idx_[16] = {0, 4, 8, 12,
                      1, 5, 9, 13,
                      2, 6, 10, 14,
                      3, 7, 11, 15};
  return __riscv_vle32_v_u32m4(idx_, 16);
}

void pffft_real_preprocess_4x4(const float *in) {
  vfloat32m1_t r0=__riscv_vle32_v_f32m1(in,4);
  vfloat32m4_t tmp = __riscv_vundefined_f32m4();
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 0, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 1, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 2, r0);
  tmp = __riscv_vset_v_f32m1_f32m4(tmp, 3, r0);
  tmp = __riscv_vrgather_vv_f32m4(tmp, transpose_indexes(), 16);
  r0 = __riscv_vget_v_f32m4_f32m1(tmp, 0);
}



when compiled with:

riscv64-linux-gnu-gcc-13 -O1 -march=rv64gcv -c testcase.c

the output is:

during RTL pass: expand
test.c: In function ‘pffft_real_preprocess_4x4’:
test.c:19:8: internal compiler error: Segmentation fault
   19 |   r0 = __riscv_vget_v_f32m4_f32m1(tmp, 0);
      |        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0xffffae3a7583 __libc_start_call_main
        ../sysdeps/nptl/libc_start_call_main.h:58
0xffffae3a7657 __libc_start_main_impl
        ../csu/libc-start.c:360
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <file:///usr/share/doc/gcc-13/README.Bugs> for instructions.

             reply	other threads:[~2023-10-23 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-23 12:52 julienpommier at free dot fr [this message]
2023-10-23 17:08 ` [Bug target/111935] " pinskia at gcc dot gnu.org
2023-10-24  7:48 ` cvs-commit at gcc dot gnu.org
2023-10-31  2:50 ` cvs-commit at gcc dot gnu.org
2024-02-17  3:30 ` aoliva at gcc dot gnu.org
2024-04-24  8:59 ` kito at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-111935-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).