re PR tree-optimization/42185 ([graphite] expected gimple_assign(error_mark), have gimple_call() in gimple_assign_rhs_code, at gimple.h:1820)

PR graphite/42185
        * graphite-sese-to-poly.c (is_reduction_operation_p): Assert that
        we are a GIMPLE_ASSIGN.  Do not calculate rhs code twice.
        (follow_ssa_with_commutative_ops): Return NULL on non assignment.

From-SVN: r155256
This commit is contained in:
Aldy Hernandez 2009-12-15 15:17:46 +00:00 committed by Aldy Hernandez
parent 3efd49f9df
commit 0596e97f1c
3 changed files with 44 additions and 2 deletions

View File

@ -1,3 +1,10 @@
2009-12-15 Aldy Hernandez <aldyh@redhat.com>
PR graphite/42185
* graphite-sese-to-poly.c (is_reduction_operation_p): Assert that
we are a GIMPLE_ASSIGN. Do not calculate rhs code twice.
(follow_ssa_with_commutative_ops): Return NULL on non assignment.
2009-12-15 Eric Botcazou <ebotcazou@adacore.com>
* config/rs6000/rs6000.md (probe_stack): Use an enclosing SET.

View File

@ -2462,9 +2462,14 @@ split_reduction_stmt (gimple stmt)
static inline bool
is_reduction_operation_p (gimple stmt)
{
enum tree_code code;
gcc_assert (is_gimple_assign (stmt));
code = gimple_assign_rhs_code (stmt);
return flag_associative_math
&& commutative_tree_code (gimple_assign_rhs_code (stmt))
&& associative_tree_code (gimple_assign_rhs_code (stmt));
&& commutative_tree_code (code)
&& associative_tree_code (code);
}
/* Returns true when PHI contains an argument ARG. */
@ -2500,6 +2505,9 @@ follow_ssa_with_commutative_ops (tree arg, tree lhs)
return NULL;
}
if (!is_gimple_assign (stmt))
return NULL;
if (gimple_num_ops (stmt) == 2)
return follow_ssa_with_commutative_ops (gimple_assign_rhs1 (stmt), lhs);

View File

@ -0,0 +1,27 @@
! { dg-compile }
! { dg-options "-fgraphite -O -ffast-math" }
MODULE powell
INTEGER, PARAMETER :: dp=8
CONTAINS
SUBROUTINE trsapp (n,npt,xopt,xpt,gq,hq,pq,delta,step,d,g,hd,hs,crvmin)
REAL(dp), DIMENSION(*), INTENT(INOUT) :: step, d, g, hd, hs
LOGICAL :: jump1, jump2
REAL(dp) :: alpha, angle, angtest, bstep, cf, cth, dd, delsq, dg, dhd, &
reduc, sg, sgk, shs, ss, sth, temp, tempa, tempb
DO i=1,n
dd=dd+d(i)**2
END DO
mainloop : DO
IF ( .NOT. jump2 ) THEN
IF ( .NOT. jump1 ) THEN
bstep=temp/(ds+SQRT(ds*ds+dd*temp))
IF (alpha < bstep) THEN
IF (ss < delsq) CYCLE mainloop
END IF
IF (gg <= 1.0e-4_dp*ggbeg) EXIT mainloop
END IF
END IF
END DO mainloop
END SUBROUTINE trsapp
END MODULE powell