tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] tcc assertion fail at x86_64-gen.c:441


From: 欧先飞
Subject: [Tinycc-devel] tcc assertion fail at x86_64-gen.c:441
Date: Mon, 7 Mar 2022 10:13:56 +0800

Reproducer:

$ cat new.c # can be found in attachment
void abort(void);
int ii;
typedef struct {
} raw_spinlock_t;
typedef struct {
  raw_spinlock_t raw_lock;
} spinlock_t;
raw_spinlock_t one_raw_spinlock(void) {
  raw_spinlock_t raw_lock;
  ii++;
  return raw_lock;
}
int main(void) {
  spinlock_t lock =
      (spinlock_t){.raw_lock = one_raw_spinlock()};
  int ctf0_idx;
  ctf0_idx = (int)0x00000000;
  int ctf0_constval;
  ctf0_constval = (int)0x00000000;
  int *ctf0_arr[] = {&ctf0_constval};
  int ctf1_idx;
  ctf1_idx = (int)0x00000000;
  int ctf1_constval;
  ctf1_constval = (int)0x00000000;
  int *ctf1_arr[] = {&ctf1_constval};
  if (((*ctf0_arr[ctf0_idx]) | (*ctf1_arr[ctf1_idx])) != 1)
    abort();
  return 0;
}

$ tcc -O0 new.c
tcc: x86_64-gen.c:441: load: Assertion `((ft & VT_BTYPE) == VT_INT) || ((ft & VT_BTYPE) == VT_LLONG) || ((ft & VT_BTYPE) == VT_PTR) || ((ft & VT_BTYPE) == VT_FUNC)' failed.
[1]    115530 abort (core dumped)  tcc -O0 new.c

my tcc version is (ubuntu 18.04)
$ tcc -v
tcc version 0.9.27 (x86_64 Linux)

Attachment: new.c
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]