[llvm-dev] Bug in use-list order serialization

Daniel Pfister via llvm-dev llvm-dev at lists.llvm.org
Mon Feb 26 06:37:02 PST 2018


I want to ask if incorrect serialization of a constant's use-list order
is considered as a bug.

While compiling some programs with

clang -c -emit-llvm -O2 -g

I noticed that for many of the bitcode files the verify-uselistorder
tool terminates with output

*** verify-uselistorder ***
verify bitcode
LLVM ERROR: use-list order changed

where the mismatch is always for the constant i64 0. This happens both
with version 5.0.1 and 6.0 RC3 of LLVM and clang. I managed to trigger
this behavior with the following reduced test-case:

#include <stdio.h>
int main (int argc, char **argv) {
  struct M { char const *a; char const *b; } const map[] = {
    { "a", "b" },
    { NULL, NULL }
  char const *foo = "foo";
  struct M const *m = map;
  while (m->a)
  if (m->b)
    foo = m->b;
  printf("%s", foo);
  return 0;


More information about the llvm-dev mailing list