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: "pinskia at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 06 Oct 2014 17:33:21 +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
Andrew Pinski <pinskia at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution|--- |INVALID
--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #3)
> Ok doing this works:
> asm("":"+r"(t)::);
>
>
> But it looks like it should not vectorize due to the number of iterations
> happening for that asm has changed.
Ok, actually if the asm result is used outside the loop, the vectorizer does
not happen but if is not used, then it happens so no wrong code.
You need some output to the inline-asm to cause it to vectorizer:
This:
{int t; asm ("":"+r"(t)::); }
Otherwise if it is volatile, it does not work as that requires that many
iterations of asm to be called.