Issue 138904
Summary Assertion failure in x86 DAG->DAG
Labels bug, backend:X86, crash-on-valid
Assignees
Reporter ilovepi
    We're seeing an assertion failure when building some code for Fuchsia.  We've had some other breakages in our CI, so I'm not 100% on when this showed up, but I'm guessing recently.

```C
// RUN: clang -cc1 -emit-obj -target-cpu x86-64-v2 -O3 -ftrivial-auto-var-init=pattern -vectorize-loops %s

void *a;
long b;
void *c() {
  if (b)
    return a;
}
typedef struct {
 char d[]
} e;
long f(unsigned g) {
  char *h;
  int i;
  e *j = c();
 if (g > 8)
    return 0;
  i = 0;
  for (; i < g; i += 2)
    h[i / 2] = j->d[i] + j->d[i + 1];
}
```

Error message:
```console
clang: /usr/local/google/home/paulkirth/llvm-fork/llvm/include/llvm/IR/Value.h:360: const_use_iterator llvm::Value::materialized_use_begin() const: Assertion `hasUseList()' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/local/google/home/paulkirth/llvm-fork/build/bin/clang -cc1 -triple x86_64-unknown-fuchsia -emit-obj -massembler-fatal-warnings -disable-free -clear-ast-before-backend -main-file-name huf_compress.c -mrelocation-model pic -pic-level 2 -pic-is-pie -mframe-pointer=non-leaf -ffp-contract=off -fno-rounding-math -mconstructor-aliases -funwind-tables=2 -enable-tlsdesc -target-cpu x86-64-v2 -mllvm -x86-branches-within-32B-boundaries -tune-cpu generic -debug-info-kind=constructor -dwarf-version=5 -debugger-tuning=gdb --compress-debug-sections=zstd -fdebug-compilation-dir=. -mllvm -crash-diagnostics-dir=clang-crashreports -ffunction-sections -fdata-sections -fcoverage-compilation-dir=. -sys-header-deps -D _LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D _LIBCPP_REMOVE_TRANSITIVE_INCLUDES -D _LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -D ZX_ASSERT_LEVEL=2 -D XXH_NAMESPACE=ZSTD_ -D ZDICTLIB_VISIBILITY= -D ZSTDERRORLIB_VISIBILITY= -D ZSTDLIB_HIDDEN= -D ZSTDLIB_VISIBILITY= -D ZSTDLIB_VISIBLE= -D PLATFORM_POSIX_VERSION=200112L -D ZSTD_SETPRIORITY_SUPPORT=0 -O3 -Wall -Wextra -Wconversion -Wextra-semi -Wimplicit-fallthrough -Wnewline-eof -Wstrict-prototypes -Wwrite-strings -Wno-sign-conversion -Wno-unused-parameter -Wnonportable-system-include-path -Wno-missing-field-initializers -Wno-extra-qualification -Wno-cast-function-type-strict -Wno-cast-function-type-mismatch -Wno-unknown-warning-option -Wno-missing-template-arg-list-after-template-kw -Wno-deprecated-pragma -Wno-nontrivial-memaccess -Werror -Wthread-safety -Wno-unknown-warning-option -Wno-thread-safety-reference-return -Wno-implicit-fallthrough -Wno-conversion -Wno-unused-but-set-variable -Wno-bitwise-instead-of-logical -ffuchsia-api-level=4293918720 -std=c11 -fconst-strings -ferror-limit 19 -fvisibility=hidden -stack-protector 2 -ftrivial-auto-var-init=pattern -fgnuc-version=4.2.1 -fskip-odr-check-in-gmf -fcolor-diagnostics -vectorize-loops -vectorize-slp -debug-info-kind=constructor -fsanitize=safe-stack -fno-sanitize-memory-param-retval -fno-sanitize-address-use-odr-indicator -faddrsig -D__GCC_HAVE_DWARF2_CFI_ASM=1 -x c huf_compress-e7770f.c
1. <eof> parser at end of file
2.      Code generation
3.      Running pass 'Function Pass Manager' on module 'huf_compress-e7770f.c'.
4.      Running pass 'X86 DAG->DAG Instruction Selection' on function '@HUF_writeCTable_wksp'
#0 0x0000560b3f3498c6 ___interceptor_backtrace ../../../../../../llvm-llvm-project/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:4513:13
#1 0x0000560b4ded743a llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) /usr/local/google/home/paulkirth/llvm-fork/llvm/lib/Support/Unix/Signals.inc:808:8
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to