[PATCH] Fix assertion failure caused by InlineCost when ptrtoint int size is larger than the pointer size

Matt Arsenault arsenm2 at gmail.com
Thu Aug 8 23:04:20 PDT 2013


On Aug 8, 2013, at 0:36 , Chandler Carruth <chandlerc at gmail.com> wrote:

>  I don't think this is the correct fix. Your original message indicates there something wrong with tracking a base and offset through an integer that happens to be wider than necessary for the pointer value?
It's more that it's different and not that it's bigger. stripAndComputeInBoundsConstantOffsets returns a constant integer that is the pointer size, and is kept in the ConstantOffsetPtrs. In the test case, when the sub is visited, it uses those 32-bit constants for constant simplified value. This simplified value is then 32 bits which is inconsistent with its uses. When the simplified value is used when visiting the icmp, it isn't the same type as the i64 other operand.

> Hard to know for sure what you're hitting without more info... But if so, we should fix that rather than tracking fewer cases through here.

I don't think it matters much in the real world, since InstCombine transforms this into a inttoptr to the right size + ext anyway. I only really ran into this by writing my artificial address space size tests.



More information about the llvm-commits mailing list