[Bug target/50683] GCC compiles MPFR 3.1.0 wrongly on sparc

ebotcazou at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Oct 16 14:45:00 GMT 2011


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

Eric Botcazou <ebotcazou at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |davem at davemloft dot net

--- Comment #5 from Eric Botcazou <ebotcazou at gcc dot gnu.org> 2011-10-16 14:45:36 UTC ---
Ugh, annoying linker relaxation bug.  The compiler correctly generates:

    add    %l7, %l3, %l3, %tgd_add(__gmpfr_flags)
[...]
    call    __tls_get_addr, %tgd_call(__gmpfr_flags)
     mov    %l3, %o0
    ld    [%o0], %g1

but the linker turns this into:

   0x00014d14 <+504>:   add  %g7, %o0, %o0
   0x00014d18 <+508>:   mov  %l3, %o0
   0x00014d1c <+512>:   ld  [ %o0 ], %g1

so segfault on the load.

Filed as http://sourceware.org/bugzilla/show_bug.cgi?id=13301 for the linker.

Should we put a workaround in the compiler?



More information about the Gcc-bugs mailing list