http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56688



             Bug #: 56688

           Summary: Fortran save statement prevents loop vectorization.

    Classification: Unclassified

           Product: gcc

           Version: 4.9.0

            Status: UNCONFIRMED

          Severity: normal

          Priority: P3

         Component: tree-optimization

        AssignedTo: unassig...@gcc.gnu.org

        ReportedBy: ysrum...@gmail.com





Analyzing gcc vectorization on 200.sixtrack from spec2000 suite we found out

that only 6 loops are vectorized in the hottest routine (97% run time). The

reason is that save statement is used. This issue can be illustrated by the

following simple example:



    subroutine bar

    implicit real*8 (a-h,o-z)

    parameter (n=700)

    common/my_data/ x1(n), y1(n), z1(n), t1(n)

        save

    do i=1,n

    x = x1(i) - y1(i)

    z1(i) = t1(i) * x

    enddo

    end



and vectorizer issues the following message:



t1.f:6: note: ==> examining statement: _6 = my_data.x1[_5];



t1.f:6: note: num. args = 4 (not unary/binary/ternary op).

t1.f:6: note: vect_is_simple_use: operand my_data.x1[_5]

t1.f:6: note: not ssa-name.

t1.f:6: note: use not simple.

t1.f:6: note: vect_model_load_cost: aligned.

t1.f:6: note: vect_model_load_cost: inside_cost = 1, prologue_cost = 0 .

t1.f:6: note: vect_is_simple_use: operand my_data.x1

t1.f:6: note: not ssa-name.

t1.f:6: note: use not simple.

t1.f:6: note: not vectorized: live stmt not supported: _6 = my_data.x1[_5];



Note also if we comment down svae stmt loop will be vectorized.

Reply via email to