Wrong check in Thumb2SizeReduction caused reduction of t2STMIA instruction
to t1STMIA even when t2STMIA has LR register in its register list. This is
wrong as register list of t1STMIA is 8 bit long (for R0-R7 only), thus LR
register (R14) is just thrown away on emitting binary representation of t1STMIA.
It causes some data to be silently lost at run-time, in very rare cases.
Details
Details
- Reviewers
t.p.northover
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Hi Sergey,
The code itself looks fine, but the test can be made much more robust, and simpler at the same time. It's always a good idea to keep some regalloc-bait handy!
declare i8* @llvm.returnaddress(i32) define i32* @foo(i32* %addr, i32 %val0) minsize { store i32 %val0, i32* %addr %addr1 = getelementptr i32* %addr, i32 1 %lr = call i8* @llvm.returnaddress(i32 0) %lr32 = ptrtoint i8* %lr to i32 store i32 %lr32, i32* %addr1 %addr2 = getelementptr i32* %addr1, i32 1 ret i32* %addr2 }
Cheers.
Tim.
Comment Actions
Hi Tim,
Thanks a lot for a much better test! I'm not good at writing IR
and tried to reduce output of Clang.
Regards,
Sergey
Comment Actions
Tim,
Great, but I don't have commit access. Could you please commit it?
Thanks,
Sergey