This is an archive of the discontinued LLVM Phabricator instance.

[X86] lea rdx, [rax - one] adds one instead of subtracts when one is a symbol that has been .set (PR33667)
AbandonedPublic

Authored by avt77 on Jul 10 2017, 8:37 AM.

Details

Summary

It's a problem in Intel syntax of asm.

Diff Detail

Event Timeline

avt77 created this revision.Jul 10 2017, 8:37 AM
RKSimon edited edge metadata.Jul 11 2017, 8:01 AM

Couple of minors

lib/Target/X86/AsmParser/X86AsmParser.cpp
1510–1511

Replace SM.getImm() with ImmVal?

test/MC/X86/intel-syntax.s
20

Interleave the CHECKs with the relevant instruction

avt77 updated this revision to Diff 106590.Jul 14 2017, 1:43 AM

I fixed Simon's comments.

RKSimon added inline comments.Jul 14 2017, 2:22 AM
lib/Target/X86/AsmParser/X86AsmParser.cpp
1517

What happens to the case where these is a Disp and ImmVal but the Disp isn't a symbol ref? That drops to the Disp = Imm case and we lose the displacement?

test/MC/X86/intel-syntax.s
20

The rest of the test file capitalizes its REGISTER - match the style?

avt77 abandoned this revision.Aug 15 2017, 8:03 AM

It's fixed in D35621