Skip to content

[HashRecognize] Miscompile due to data evolution with an outside user: poison generated #165382

@iamanonymouscs

Description

@iamanonymouscs

This program returns 0 at -O0/s and 139 at -O1/2/3

int a, b;
short c, e;
long d[56];
int main() {
  a = 0;
  for (; a < 6; a++) {
    b = 0;
    for (; b < 8; b++) {
      if ((e ^ c) & 32768)
        e = e << 1 ^ 3;
      else
        e <<= 1;
      c <<= 1;
    }
    d[b + c - a] = 0;
  }
}

Compiler Explorer: https://godbolt.org/z/fxjj1o4Yf

Metadata

Metadata

Assignees

Labels

llvm:analysisIncludes value tracking, cost tables and constant foldingmiscompilation

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions