Daniel Pfister via llvm-dev
2018-Feb-26 14:37 UTC
[llvm-dev] Bug in use-list order serialization
Hello, 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) m++; if (m->b) foo = m->b; printf("%s", foo); return 0; } Regards, Daniel
Duncan P. N. Exon Smith via llvm-dev
2018-Mar-14 00:29 UTC
[llvm-dev] Bug in use-list order serialization
Yes, this is a bug. Please file a PR, attach a .ll and/or .bc file, and CC me. Bonus points if you bugpoint reduce it first.> On Feb 26, 2018, at 06:37, Daniel Pfister via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > Hello, > > 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) > m++; > if (m->b) > foo = m->b; > printf("%s", foo); > return 0; > } > > Regards, > Daniel > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Possibly Parallel Threads
- [LLVMdev] [RFC] Setting preserve-bc-use-list-order=true by default
- Size of produced binaries when compiling llvm & clang sources
- IVUsers pass is fragile. Is this okay? How can it be resolved?
- Removing LLVM testing tools from the install distribution
- Representations of IR in the output of opt