google / souper

A superoptimizer for LLVM IR
Apache License 2.0
2.17k stars 170 forks source link

sclang crash - error in backend: no input available for 1_1 #487

Open pranavk opened 5 years ago

pranavk commented 5 years ago

Compiling following program with:

./sclang -mllvm -souper-infer-inst -mllvm -souper-synthesis-comps=bitreverse -c -O2 /tmp/tmp.c

enum { a = 1000 };
typedef struct {
  unsigned c;
} d;
typedef struct {
  d e;
} f;
unsigned g, h;
int j(unsigned *k, f l[], int m) {
  long i = 0;
  for (; i < m; ++i)
    if (g)
      *k = l[i].e.c;
  return 0;
}
int o() {
  unsigned b;
  f n[] = {{}, a};
  j(&b, n, sizeof(0));
  h = b;
  return h;
}

Make sure to flush your redis cache before executing the command.

LebedevRI commented 5 years ago

Random thought: is the error coming from alive?

pranavk commented 5 years ago

shouldn't be. I am not using the alive backend in the command line. Alive backend only gets used with -souper-use-alive.

regehr commented 5 years ago

@pranavk usually we just run commands standalone using SOUPER_NO_EXTERNAL_CACHE=1 to avoid redis interactions

pranavk commented 5 years ago

oh. good to know. I was flushing my cache everytime until now. Will make use of this from now