On Thu, 11 Jan 2018, Peter Zijlstra wrote:

> > I think I heard that retpolines won't be ported to anything older than
> > GCC 4.9, so maybe it's safe to use '%='.  I don't remember when it was
> > introduced into GCC though.
> 
> root@interlagos:~/tmp# gcc-4.8 -o test test.c
> root@interlagos:~/tmp# ./test
> 11
> 
> --- test.c
> 
> #include <stdio.h>
> 
> void main(void)
> {
>         int val;
> 
>         asm ("mov $(%=),%0" : "=A" (val));
> 
>         printf("%d\n", val);
> }

        # gcc --version
        gcc (SUSE Linux) 4.3.4 [gcc-4_3-branch revision 152973]
        # ./test 
        8

So this part is OK. The asm-goto hard dependency would be worse with that 
compiler though.

-- 
Jiri Kosina
SUSE Labs

Reply via email to