llvm-project
llvm-project copied to clipboard
Slow compound value binding with C99 designated initializers.
https://discourse.llvm.org/t/enormously-huge-analysis-time/60969
The following code takes 30+ minutes to --analyze:
extern int f (const char *);
int g (int x) {
char *v[] = {
[0] = "",
[1234] = "aaaa",
[123456] = "bbbb",
};
return x < 0 ? -1 : f (v[x]);
}
Looks like we're trying to create a symbolic array of 123456 elements and explicitly write down each element, and then expand it into separate RegionStore bindings element-by-element. The analysis assumes that if elements are explicitly written down, there's few of them so explicitly writing them down doesn't hurt. The C99 designated initializer syntax used here suggests otherwise.
@llvm/issue-subscribers-clang-static-analyzer