http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47259

--- Comment #4 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-01-12 
13:32:32 UTC ---
In 99.9999% of all cases there is a better way than using a global register
variable.

Also it is not clear to me how to merge translation units where a different
set of registers are used in global register variables.  Consider

t1.c:
int g asm("%ecx");

t2.c:
void foo(void)
{
  complex-asm-that-needs-many-regs
}

if we make ecx global in t2.c then we'd fail to assign registers to
the complex asm.  Thus one solution would be to partition the LTO
program in a way that t1.c is completely contained in its own
partition.  But then the user could have compiled t1.c without LTO
which would be my suggested workaround.  Thus, emit

sorry: translation units with global register variables need to be compiled
without LTO

Reply via email to