A shift-left > 63 triggers a UBSAN failure. This patch kicks the can down the road (to the consumer) by emitting a more compact representation of the shift computation in DWARF expressions.
Details
Diff Detail
Event Timeline
Apologies, I accidentally pushed this commit instead of a different one. Reverted in 3efa016d4c1a, this one still needs to be reviewed!
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | ||
---|---|---|
688 | I had some trouble figuring out what the 1+1+1+1+1 was supposed to represent. In case anyone is wondering it's 1 byte per DWARF opcode and 1 byte for the small ULEB128 in the alternative encoding below. Maybe we should make that more clear in the comment or used a named temporary/ Also, should we use (FromBits+6)/7 to ensure we always round up? |
Hi Adrian, the test you updated in your commit is failing on the PS4 linux bot, can you take a look?
On the main llvm waterfall too: https://lab.llvm.org/buildbot/#/builders/57/builds/14335
llvm/lib/CodeGen/AsmPrinter/DwarfExpression.cpp | ||
---|---|---|
688 | Agree with you. This should be reworked /commented more. |
I had some trouble figuring out what the 1+1+1+1+1 was supposed to represent. In case anyone is wondering it's 1 byte per DWARF opcode and 1 byte for the small ULEB128 in the alternative encoding below. Maybe we should make that more clear in the comment or used a named temporary/
Also, should we use (FromBits+6)/7 to ensure we always round up?