https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106712
--- Comment #1 from Ed Catmur <ed at catmur dot uk> --- I believe this is happening because start_decl can modify prefix_attributes (by first chaining it onto attributes, then passing the merged chain to grokdeclarator which can then chain onto that merged chain). If the attribute list is empty, prefix_attributes is NULL_TREE and so is not affected. If so, the simplest fix would be for start_decl to copy_list(prefix_attributes) prior to chaining it.