]> git.ipfire.org Git - thirdparty/gcc.git/commit
crc: Error out on non-constant poly arguments for the crc builtins [PR120709]
authorAndrew Pinski <quic_apinski@quicinc.com>
Sun, 6 Jul 2025 17:20:26 +0000 (10:20 -0700)
committerAndrew Pinski <quic_apinski@quicinc.com>
Mon, 7 Jul 2025 06:13:54 +0000 (23:13 -0700)
commitbe07dd9a96a7a6f8fb59c939eda84d74b54f8182
tree43c5cff89b52ef36c79321b8dcb5e88759dcefba
parenta96bcdf0fce13865817e754ff78c2f0167b34c10
crc: Error out on non-constant poly arguments for the crc builtins [PR120709]

These builtins requires a constant integer for the third argument but currently
there is assert rather than error. This fixes that and updates the documentation too.
Uses the same terms as was being used for the __builtin_prefetch arguments.

Bootstrapped and tested on x86_64-linux-gnu.

PR middle-end/120709

gcc/ChangeLog:

* builtins.cc (expand_builtin_crc_table_based): Error out
instead of asserting the 3rd argument is an integer constant.
* internal-fn.cc (expand_crc_optab_fn): Likewise.
* doc/extend.texi (crc): Document requirement of the poly argument
being a constant.

gcc/testsuite/ChangeLog:

* gcc.dg/crc-non-cst-poly-1.c: New test.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
gcc/builtins.cc
gcc/doc/extend.texi
gcc/internal-fn.cc
gcc/testsuite/gcc.dg/crc-non-cst-poly-1.c [new file with mode: 0644]