Skip to content

After r313012, Assertion failed: (ExitCount != SE.getCouldNotCompute() && "Invalid loop count"), function generateOverflowCheck, file lib/Analysis/ScalarEvolutionExpander.cpp, line 2126. #35380

@DimitryAndric

Description

@DimitryAndric
Bugzilla Link 36032
Resolution FIXED
Resolved on Feb 26, 2018 16:26
Version trunk
OS All
Blocks #35152
CC @aelovikov-intel,@emaste,@zmodem,@sbaranga-arm

Extended Description

As reported in https://bugs.freebsd.org/225345, building the FreeBSD games/scummvm port for AArch64 with clang 6.0.0 results in an assertion:

Assertion failed: (ExitCount != SE.getCouldNotCompute() && "Invalid loop count"), function generateOverflowCheck, file /usr/local/poudriere/jails/head-arm64/usr/src/contrib/llvm/lib/Analysis/ScalarEvolutionExpander.cpp, line 2152.

This assertion still occurs with trunk r322755, and bisection shows it has regressed with https://reviews.llvm.org/rL313012 ("[LAA] Allow more run-time alias checks by coercing pointer expressions to AddRecExprs") by Silviu Baranga.

Minimized test case:

// clang -cc1 -triple aarch64-- -S -O1 -vectorize-loops graphics-minimized.cpp
struct {
void *a();
} b;
char c[6];
void d() {
unsigned char *e = (unsigned char *)b.a();
unsigned short f;
for (;;) {
for (unsigned g; g < 4; g++)
e[g] = c[g + f];
f += 4;
}
}

Note that -vectorize-loops is essential for reproducing the assertion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzilla

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions