-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression(r272251): error in backend: Cannot select: t45: i32 = ARMISD::BFI t4, Constant:i32<1>, t34 #28722
Comments
Looking through |
Yup, reverting that locally makes the assert go away. James, does this look like an easy fix, or should we revert? |
Also, do you see an easy workaround around this crash until we can deploy a fixed compiler? |
Workaround: Use |
Hum, this sounds like constant folding / CSE, and not a case Jame's patch [1] was testing for. Probably this has provided a case which he wasn't expecting, and the testing wasn't really that thorough... :/ Maybe reverting the patch for now would be a good thing, unless James has a quick fix (and more tests!). cheers, [1] http://llvm.org/viewvc/llvm-project?view=revision&revision=272251 |
Hm, this might fix it: Index: lib/Target/ARM/ARMISelDAGToDAG.cpp--- lib/Target/ARM/ARMISelDAGToDAG.cpp (revision 274127)
|
Hm no, that's not good, BIC is AND NOT. |
$ svn commit -m 'Revert r272251, it caused #28722 .' $ svn commit -m 'Add a regression test for #28722 .' |
reduced.c |
Hi Nico, Thanks for bringing this to my attention, and sorry that I didn't act on it quickly as I was on vacation. The underlying problem is actually my use of DAG->getConstant. I should be using DAG->getTargetConstant. The use of getConstant() in this testcase actually increments the use count of Constant<4095> from one to two. In this case, the lowering of ARMISD::BFI is contingent on its constant argument only having one use - if it's shared, ISel falls over. I've committed a fixed version in r274510. Cheers, James |
Extended Description
thakis@thakis:/tmp$ cat repro.cc
struct A { A(char*); };
struct D : A {
D(char* p1) : A(p1) {}
};
class C {
void m_fn1(int a);
char *ValidateFrame_data_ptr;
};
void C::m_fn1(int a) {
D(new char[a & ~4095]);
ValidateFrame_data_ptr += 4096 + (a & 4095);
}
thakis@thakis:/tmp$ $HOME/src/llvm-build/bin/clang-3.8 -cc1 -triple thumbv7--linux-android -emit-obj -Os repro.cc
fatal error: error in backend: Cannot select: t45: i32 = ARMISD::BFI t4, Constant:i32<1>, t34
t4: i32,ch = CopyFromReg t0, Register:i32 %vreg1
t3: i32 = Register %vreg1
t44: i32 = Constant<1>
t34: i32 = t2MOVi16 TargetConstant:i32<4095>, TargetConstant:i32<14>, Register:i32 %noreg
t56: i32 = TargetConstant<4095>
t51: i32 = TargetConstant<14>
t52: i32 = Register %noreg
In function: _ZN1C5m_fn1Ei
The text was updated successfully, but these errors were encountered: