From: Martin Liska Date: Thu, 18 Jun 2020 07:11:31 +0000 (+0200) Subject: Add missing check for gassign. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d11c9841d54ed74978f8d0e0f352631f90504dd5;p=gcc.git Add missing check for gassign. gcc/ChangeLog: * tree-vect-generic.c (expand_vector_condition): Check for gassign before inspecting RHS. --- 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);