https://bugs.llvm.org/show_bug.cgi?id=41117

            Bug ID: 41117
           Summary: After r343028, Assertion failed: (isa<X>(Val) &&
                    "cast<Ty>() argument of incompatible type!"), function
                    cast, file include/llvm/Support/Casting.h, line 255.
           Product: new-bugs
           Version: trunk
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: new bugs
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

As described in https://bugs.freebsd.org/236566, compiling the FreeBSD
java/openjdk8 port for armv7 or aarch64 asserts with:

Assertion failed: (isa<X>(Val) && "cast<Ty>() argument of incompatible type!"),
function cast, file include/llvm/Support/Casting.h, line 255.

Bisection shows this started occurring after https://reviews.llvm.org/rL343028
("[LV][LAA] Vectorize loop invariant values stored into loop invariant
address").

Minimized test case:

// clang -cc1 -triple aarch64-- -S -fno-delete-null-pointer-checks -O2
-vectorize-loops instanceKlass-min.cpp
void *a;
struct d {
  template <class c> c *g(int) const;
};
struct i {
  int e;
  template <class c> void f(c *);
};
struct l {
  int count() { return h; }
  int h;
};
int j;
template <class c> c *d::g(int) const {
  a = &((char *)0)[j];
  return (c *)a;
}
template <class c> void i::f(c *) { e = 0; }
d k;
void p() {
  i *b = 0;
  l *m = 0;
  l n;
  while (m < &n) {
    unsigned *o(k.g<unsigned>(0));
    unsigned *c = o + m->count();
    while (o < c) {
      b->f(o);
      ++o;
    }
    ++m;
  }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to