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

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.


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