If we use Intal syntax assembler and deal with negative value of Scale in LEA instruction then Clang crashes (see pr33661 for details).
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
532 ↗ | (On Diff #105609) | Add newlines before/after the function and pass it through clang-format |
553 ↗ | (On Diff #105609) | if (checkScale(ErrMsg)) return true; |
605 ↗ | (On Diff #105609) | if (checkScale(ErrMsg)) return true; |
test/CodeGen/ARM/arguments-nosplit-double.ll | ||
11 ↗ | (On Diff #105609) | NFC commit? |
test/CodeGen/ARM/arguments-nosplit-i64.ll | ||
11 ↗ | (On Diff #105609) | NFC commit? |
test/MC/X86/intel-syntax-invalid-scale.s | ||
---|---|---|
12 ↗ | (On Diff #105645) | Any idea why this error message is different? Is it worth fixing? |
test/MC/X86/intel-syntax-invalid-scale.s | ||
---|---|---|
12 ↗ | (On Diff #105645) | gcc produces the same message like above 3 ones but Clang does what we see. Clang does it automatically (without any my intervation) that's why I decided don't touch it. But I could try to fix. |
test/MC/X86/intel-syntax-invalid-scale.s | ||
---|---|---|
12 ↗ | (On Diff #105645) | Do you think you can easily add it to this patch or would it be better to separate it as a follow up patch? |
test/MC/X86/intel-syntax-invalid-scale.s | ||
---|---|---|
12 ↗ | (On Diff #105645) | I'm no sure it's easy but I'll try to do it tomorrow. If I fail... |
test/MC/X86/intel-syntax-invalid-scale.s | ||
---|---|---|
12 ↗ | (On Diff #105645) | I need some more time to fix it that's why it's better to do it in the follow up patch. |
lib/Target/X86/AsmParser/X86AsmParser.cpp | ||
---|---|---|
129 ↗ | (On Diff #105645) | Improve the comment to explain that the invalid value will be caught later by checkScale |
This patch replaces assertions with normal diagnostic when it's possible. Now we see normal error messages instead of compiler crashes. It should close PR33861, PR33862 and PR33661. In addition the patch prepares tests for D35621.
LGTM with one minor
test/MC/X86/intel-syntax2.s | ||
---|---|---|
2 ↗ | (On Diff #107675) | Very minor but please call this file intel-syntax-3.s (we already have a intel-syntax-2.s). |