This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: libgcc/sync.c vs. cgraph alias tracking
- From: Richard Sandiford <rsandifo at linux dot vnet dot ibm dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: Jan Hubicka <hubicka at ucw dot cz>, gcc at gcc dot gnu dot org
- Date: Wed, 09 Oct 2013 10:56:33 +0100
- Subject: Re: libgcc/sync.c vs. cgraph alias tracking
- Authentication-results: sourceware.org; auth=none
- References: <87fvsbr0ud dot fsf at talisman dot default> <20131008235726 dot GA24598 at atrey dot karlin dot mff dot cuni dot cz> <878uy3q6vx dot fsf at talisman dot default> <20131009085935 dot GC22558 at kam dot mff dot cuni dot cz> <20131009092400 dot GL30970 at tucnak dot zalov dot cz>
Jakub Jelinek <jakub@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" } } */