This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/63467] should have asm statement that does not prevent vectorization


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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
Why not use a label?

#define N 100
int a[N], b[N], c[N];

main()
{
  static void *x __attribute__((used)) = &&bar;
  int i;
  for (i = 0; i < N; i++) {
bar:
      a[i] = b[i] + c[i];
  }
}

will get you

.L2:
        movdqa  b(%rax), %xmm0
        addq    $16, %rax
        paddd   c-16(%rax), %xmm0
        movaps  %xmm0, a-16(%rax)
        cmpq    $400, %rax
        jne     .L2

...

        .type   x.1751, @object
        .size   x.1751, 8
x.1751:
        .quad   .L2

(ok, the label isn't called 'bar' anymore for some dubious reason).  Maybe
there is a more fancy way to mark the label used than taking its address
(a "used" attribute on the label itself is ignored).

The code_label ("bar") survives until the very end but it seems that asmout
transforms local labels to the .L<d> form unconditionally.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]