From d11c9841d54ed74978f8d0e0f352631f90504dd5 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 18 Jun 2020 09:11:31 +0200 Subject: [PATCH] Add missing check for gassign. gcc/ChangeLog: * tree-vect-generic.c (expand_vector_condition): Check for gassign before inspecting RHS. --- gcc/tree-vect-generic.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c index fb955bbf3d2..83d399a7898 100644 --- a/gcc/tree-vect-generic.c +++ b/gcc/tree-vect-generic.c @@ -957,8 +957,9 @@ expand_vector_condition (gimple_stmt_iterator *gsi) if (code == SSA_NAME) { - gimple *assign = SSA_NAME_DEF_STMT (a); - if (TREE_CODE_CLASS (gimple_assign_rhs_code (assign)) == tcc_comparison) + gassign *assign = dyn_cast (SSA_NAME_DEF_STMT (a)); + if (assign != NULL + && TREE_CODE_CLASS (gimple_assign_rhs_code (assign)) == tcc_comparison) { a_is_comparison = true; a1 = gimple_assign_rhs1 (assign); -- 2.30.2