https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93384

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW

--- Comment #21 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Jakub Jelinek from comment #20)
> I've tried to create small testcase for this:
> __attribute__((noipa, noreturn)) void foo (void) { while (1) ; }
> __attribute__((noinline)) void bar (void) { asm (""); foo (); }
> void baz (int x) { if (x) bar (); }
> and
> extern void bar (void);
> void qux (int x) { if (!x) bar (); }
> 
> ./xgcc -B ./ -O2 -flto -ffat-lto-objects pr93384_0.c -S -fpic
> -fno-semantic-interposition
> ./xgcc -B ./ -O2 -flto -ffat-lto-objects pr93384_1.c -S -fpic
> -fno-semantic-interposition
> as -o pr93384_0.{o,s}
> as -o pr93384_1.{o,s}
> ./xgcc -B ./ -O2 -flto -shared -fpic -fno-semantic-interposition -o
> pr93384.so pr93384_{0,1}.o -save-temps -v -flto-partition=one
> 
> but unfortunately (at least on x86_64-linux) it doesn't reproduce this, the
> bar.localalias gets suffixed in one case to bar.localalias.lto_priv.0 and in
> another one (though it didn't exist in the assembly at that point) to
> bar.localalias.lto_priv.1.

Ah, what matters is -flto-partition=none that I was missing from the above.
With that the above reproduces it:
./xgcc -B ./ -O2 -flto -ffat-lto-objects pr93384_0.c -c -fpic \
-fno-semantic-interposition
./xgcc -B ./ -O2 -flto -ffat-lto-objects pr93384_1.c -c -fpic \
-fno-semantic-interposition
./xgcc -B ./ -O2 -flto -shared -fpic -fno-semantic-interposition -o \
pr93384.so pr93384_{0,1}.o -save-temps -v -flto-partition=none
grep localalias pr93384_0.s
        .set    bar.localalias,bar
        .set    bar.localalias,bar
        jmp     bar.localalias
        call    bar.localalias
Now, gas on x86_64-linux can deal with that, but on powerpc64le-linux can't.

Reply via email to