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

            Bug ID: 34135
           Summary: [NewGVN] Assertion `BeforeCC->isEquivalentTo(AfterCC)
                    && "Value number changed after main loop completed!"'
                    failed
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedb...@nondot.org
          Reporter: mcros...@codeaurora.org
                CC: llvm-bugs@lists.llvm.org

test.cpp:
template <class E> class A {
public:
  E* ep;
  void add(const E& e);
};
class OJ;
typedef OJ* OJpt;
typedef OJpt* OJppt;
class OJ {
public:
  signed int m;
  A <OJpt> nb1ar;
};
class foo {
  void test();
public:
  OJppt regionp;
  inline OJpt& regp(signed int x, signed int y) {
    return regionp[x+y*sizex];
  }
  signed int maxx,maxy;
  signed int sizex,sizey;
};
void foo::test() {
  signed int x,y,x1,y1;
  OJpt regionp,region2p;
  for (y=1; y<=maxy-1; y++)
    for (x=1; x<=maxx-1; x++) {
      for (y1=y-1; y1<=y+1; y1++)
        for (x1=x-1; x1<=x+1; x1++) {
          region2p=regp(x1,y1);
          if (region2p)
            if (regionp!=region2p) {
              region2p->nb1ar.add(regionp);
            }
        }
    }
}

Reproduce with:
clang -O2 -mllvm -enable-newgvn ./test.cpp

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to