[PATCH] D106817: [PowerPC] Changed sema checking range for tdw td builtin
Albion Fung via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jul 26 12:16:48 PDT 2021
Conanap created this revision.
Herald added subscribers: steven.zhang, shchenz, nemanjai.
Conanap requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
To match xlc behaviour and definition in the PowerPC ISA3.1,
it is a better idea to have the compiler produce an error when a
0 is passed to the builtin. This patch changes the accepted range
from 0 to 31 to 1 to 31.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D106817
Files:
clang/lib/Sema/SemaChecking.cpp
Index: clang/lib/Sema/SemaChecking.cpp
===================================================================
--- clang/lib/Sema/SemaChecking.cpp
+++ clang/lib/Sema/SemaChecking.cpp
@@ -3395,7 +3395,7 @@
return SemaBuiltinConstantArgRange(TheCall, 3, 0, 7);
case PPC::BI__builtin_ppc_tw:
case PPC::BI__builtin_ppc_tdw:
- return SemaBuiltinConstantArgRange(TheCall, 2, 0, 31);
+ return SemaBuiltinConstantArgRange(TheCall, 2, 1, 31);
case PPC::BI__builtin_ppc_cmpeqb:
case PPC::BI__builtin_ppc_setb:
case PPC::BI__builtin_ppc_maddhd:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106817.361752.patch
Type: text/x-patch
Size: 557 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210726/71729622/attachment.bin>
More information about the cfe-commits
mailing list