Skip to content

[clang] Assertion failed in VPlan.cpp:258 #111042

@cardigan1008

Description

@cardigan1008

When I compiled the code with -O2 flag, it crashed:

#include <stdint.h>
static uint8_t c[] = {1};
void a();
long b(int h) {
  long d = 0;
  if (h < 0)
    return -1;
  int e = 0;
  for (int f = 0; f <= h; f++) {
    e++;
    d += f;
  }
  long a = d / e;
  return a;
}
void g();
uint8_t i() {
  uint16_t k[4];
  int f;
  for (; g + f < 4; f++)
    k[b(c[0] - 1)] = 5;
  for (; f; a(k))
    ;
  uint8_t *l[3][3], j;
  l[0][j] = c;
}

The crash is:

clang: /root/llvm-project/llvm/lib/Transforms/Vectorize/VPlan.cpp:258: llvm::Value* llvm::VPTransformState::get(llvm::VPValue*, bool): Assertion `(VF.isScalar() || Def->isLiveIn() || hasVectorValue(Def) || !vputils::onlyFirstLaneUsed(Def) || (hasScalarValue(Def, VPLane(0)) && Data.VPV2Scalars[Def].size() == 1)) && "Trying to access a single scalar per part but has multiple scalars " "per part."' failed.

Details can be found here: https://godbolt.org/z/fTrKKha5E

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashPrefer [crash-on-valid] or [crash-on-invalid]regression:19Regression in 19 releasevectorizers

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions