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

Li Pan <pan2.li at intel dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pan2.li at intel dot com

--- Comment #11 from Li Pan <pan2.li at intel dot com> ---
(In reply to JuzheZhong from comment #8)
> Li Pan will investigate it. He will note me if there is a bug in vsetvl pass.

The interesting thing is that I cannot fully reproduce this with build
20231210.

PASS >> ../build-qemu/qemu-riscv64 -cpu rv64,vlen=128,v=true,vext_spec=v1.0
test.rv64gc.elf

FAIL ../build-qemu/qemu-riscv64 -cpu rv64,vlen=128,v=true,vext_spec=v1.0
test.gcv.elf
Segmentation fault (core dumped)

It will be PASS if built with rv64gc but got a segment fault in printf when
built with rv64gcv. Thus I did some adjusting for this case to bypass the
segment, and then have the rv64gcv pass. Update the modified test case as
below.

qemu-riscv64 version 8.1.92 (v8.2.0-rc2-48-gd451e32ce8).
newlib for gcc build.

Modified test case:

int a, b, l, i, p, q, t, n, o;
int *volatile c;
static int j;
static struct pack_1_struct d;
long e;
char m = 5;
short s;

#pragma pack(1)
struct pack_1_struct {
  long c;
  int d;
  int e;
  int f;
  int g;
  int h;
  int i;
} h, r = {1}, *f = &h, *volatile g;

int main() {
  int u;
  j = 0;

  for (; j < 9; ++j) {
    u = ++t ? a : 0;
    if (u) {
      int *v = &d.d;
      *v = g || e;
      *c = 0;
      *f = h;
    }
    s = l && c;
    o = i;
    d.f || (p = 0);
    q |= n;
  }

  r = *f;

  if (m == 5)        // Reference m like print
    return 0;

  return 1234;
}

Reply via email to