https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78419
--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> --- Author: jakub Date: Wed Dec 7 22:52:39 2016 New Revision: 243404 URL: https://gcc.gnu.org/viewcvs?rev=243404&root=gcc&view=rev Log: Backported from mainline 2016-11-18 Jakub Jelinek <ja...@redhat.com> PR middle-end/78419 * multiple_target.c (get_attr_len): Start with argnum and increment argnum on every arg. Use strchr in a loop instead of counting commas manually. (get_attr_str): Increment argnum for every comma in the string. (separate_attrs): Use for instead of while loop, simplify. (expand_target_clones): Rename defenition argument to definition. Free attrs and attr_str even when diagnosing errors. Temporarily change input_location around targetm.target_option.valid_attribute_p calls. Don't emit warning or errors if that function fails. * gcc.target/i386/pr78419.c: New test. Added: branches/gcc-6-branch/gcc/testsuite/gcc.target/i386/pr78419.c Modified: branches/gcc-6-branch/gcc/ChangeLog branches/gcc-6-branch/gcc/multiple_target.c branches/gcc-6-branch/gcc/testsuite/ChangeLog