https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90622
--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Georg-Johann Lay <g...@gcc.gnu.org>: https://gcc.gnu.org/g:dad3c18fbb481ab31f1586b8f980940fa55951b8 commit r14-1025-gdad3c18fbb481ab31f1586b8f980940fa55951b8 Author: Georg-Johann Lay <a...@gjlay.de> Date: Sun May 21 18:54:21 2023 +0200 target/90622: __builtin_avr_insert bits: Use BLD/BST for one bit in place. If just one bit is inserted in the same position like with: __builtin_avr_insert_bits (0xFFFFF2FF, src, dst); a BLD/BST sequence is better than XOR/AND/XOR. Thus, don't fold that case to the latter sequence. gcc/ PR target/90622 * config/avr/avr.cc (avr_fold_builtin) [AVR_BUILTIN_INSERT_BITS]: Don't fold to XOR / AND / XOR if just one bit is copied to the same position.