The current constraint logic is both too lax and too strict. It fails for input outside the [INT_MIN..INT_MAX] range, but it also implicitly accepts 0 as value when it should not. Adjust logic to handle both correctly.
Details
Details
- Reviewers
compnerd - Commits
- rG768197544c71: Merging r354937: --------------------------------------------------------------…
rL355673: Merging r354937:
rG49ef2a4acdbb: Fix inline assembler constraint validation
rC354937: Fix inline assembler constraint validation
rL354937: Fix inline assembler constraint validation
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
include/clang/Basic/TargetInfo.h | ||
---|---|---|
860 ↗ | (On Diff #188265) | Isn't the "ImmSet.count" call still wrong? It looks like it crashes on an 128-bit immediate, and implicitly truncates a 64-bit immediate. I guess you could check Value.isSignedIntN(32)? |
include/clang/Basic/TargetInfo.h | ||
---|---|---|
860 ↗ | (On Diff #188265) | I've added that and a test case for truncation as a follow-up. |