https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124289
--- Comment #1 from Michal Jireš <mjires at gcc dot gnu.org> ---
These name conflicts are handled in create_asm_partitions for other
partitionings.
-flto-partition=cache does not use it, because in principle there are better
ways to handle toplevel asm, but I didn't implement those.
So the easy fix should be to use create_asm_partitions in
-flto-partition=cache, at least for now.
This fails with gas:
$ cat topasm-1.c
static int a;
asm (".local %cc0\n %cc0: .long 0" :: ":"(&a));
int main() {}
$ cat topasm-2.c
static int a;
asm (".local %cc0\n %cc0: .long 0" :: ":"(&a));
$ gcc topasm-* -flto -flto-partition=cache