https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91505
--- Comment #8 from rsandifo at gcc dot gnu.org <rsandifo at gcc dot gnu.org> --- Author: rsandifo Date: Wed Aug 21 13:59:31 2019 New Revision: 274799 URL: https://gcc.gnu.org/viewcvs?rev=274799&root=gcc&view=rev Log: [C++] Protect call to copy_attributes_to_builtin (PR91505) copy_attributes_to_builtin only handles BUILT_IN_NORMAL, but C++ was calling it immediately after the: if (DECL_BUILT_IN_CLASS (newdecl) == BUILT_IN_NORMAL) block. The corresponding C code calls it inside the block instead. 2019-08-21 Richard Sandiford <richard.sandif...@arm.com> gcc/cp/ PR c++/91505 * decl.c (duplicate_decls): Call copy_attributes_to_builtin inside the BUILT_IN_NORMAL block rather than afterward. gcc/testsuite/ PR c++/91505 * g++.target/i386/crc32-4.C: New test. Added: trunk/gcc/testsuite/g++.target/i386/crc32-4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog