[Bug tree-optimization/51058] [4.7 Regression] ICE: gimple check: expected gimple_assign(error_mark), have gimple_call() in gimple_assign_rhs_code, at gimple.h:1992
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Wed Nov 9 17:20:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51058
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> 2011-11-09 17:15:17 UTC ---
(In reply to comment #1)
> I guess it'd better be
>
> SUBROUTINE MLIST(MOLsp,PBCx,PBCy,PBCz, X0)
> IMPLICIT NONE
> INTEGER, PARAMETER :: NM=16384
> INTEGER :: MOLsp, i
> REAL :: PBCx, PBCy, PBCz, boxjmp, HALf=1./2.
> REAL :: X0(2,-2:NM)
>
> DO i = 1 , MOLsp
> boxjmp = PBCx*INT(X0(1,i)+SIGN(HALf,X0(1,i)))
> X0(1,i) = X0(1,i) - boxjmp
> boxjmp = PBCy*INT(X0(2,i)+SIGN(HALf,X0(2,i)))
> X0(2,i) = X0(2,i) - boxjmp
> ENDDO
> END
>
> otherwise it's an interleaving group of 3, which is only supported on NEON,
> AFAIK. I also changed the type to REAL to make it work (fail) on power.
>
>
> This patch fixes the problem:
> Index: tree-vect-slp.c
> ===================================================================
> --- tree-vect-slp.c (revision 181190)
> +++ tree-vect-slp.c (working copy)
> @@ -2191,10 +2191,13 @@ vect_get_constant_vectors (tree op, slp_tree slp_n
> VEC (tree, heap) *voprnds = VEC_alloc (tree, heap, number_of_vectors);
> bool constant_p, is_store;
> tree neutral_op = NULL;
> - enum tree_code code = gimple_assign_rhs_code (stmt);
> + enum tree_code code = ERROR_MARK;
> gimple def_stmt;
> struct loop *loop;
>
> + if (is_gimple_assign (stmt))
> + code = gimple_assign_rhs_code (stmt);
> +
You could as well do
else if (is_gimple_call (stmt))
code = CALL_EXPR;
like elsewhere and in the loop just test code == CALL_EXPR.
> @@ -2304,6 +2305,10 @@ vect_get_constant_vectors (tree op, slp_tree slp_n
> op = gimple_assign_rhs3 (stmt);
> }
> }
> + else if (is_gimple_call (stmt))
> + op = gimple_op (stmt, op_num + 3);
Guess it would be nicer to use gimple_call_arg (stmt, op_num); here.
More information about the Gcc-bugs
mailing list