This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/63467] should have asm statement that does not prevent vectorization
- From: "rguenth at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 07 Oct 2014 08:11:41 +0000
- Subject: [Bug tree-optimization/63467] should have asm statement that does not prevent vectorization
- Auto-submitted: auto-generated
- References: <bug-63467-4 at http dot gcc dot gnu dot org/bugzilla/>
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.