Jakub Jelinek <ja...@redhat.com> writes: > On Wed, Oct 09, 2013 at 10:59:35AM +0200, Jan Hubicka wrote: >> I see, the previous implementation tricked the one-declaration rule by >> introducing two names. What made the difference is that the second name >> is expanded as builtin... >> >> So you don't have __bulitin_sync_synchronize() at hand that would be >> translated >> to __sync_synchronize libcall? > > No, __sync_* and __atomic_* builtins don't use __builtin_ prefix. > > Would asm redirect instead of alias work? > void sync_synchronize (void) __asm ("__sync_synchronize"); > or is that going to break too (or might break soon)?
Thanks, that works. I'll change libgcc/sync.c and test. Would it be OK to add a test like the below so that it gets some non-MIPS coverage? I checked that it passes on x86_64-linux-gnu with {,-m32,-m32/-march=i386}. Richard gcc/testsuite/ * gcc.target/i386/asm-rename-1.c: New file. Index: gcc/testsuite/gcc.target/i386/asm-rename-1.c =================================================================== --- /dev/null 2013-10-09 10:21:20.288269980 +0100 +++ gcc/testsuite/gcc.target/i386/asm-rename-1.c 2013-10-09 10:49:02.941805955 +0100 @@ -0,0 +1,8 @@ +void sync_synchronize (void) __asm ("__sync_synchronize"); +void sync_synchronize (void) +{ + __sync_synchronize (); +} +/* { dg-final { scan-assembler "__sync_synchronize" } } */ +/* { dg-final { scan-assembler "\t(lock;|mfence)" } } */ +/* { dg-final { scan-assembler-not "\tcall" } } */