aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2020-06-18 09:11:31 +0200
committerMartin Liska <mliska@suse.cz>2020-06-18 10:09:40 +0200
commitd11c9841d54ed74978f8d0e0f352631f90504dd5 (patch)
treeb3c44ed14caebde97f2f4e1af6c863d803445df1
parent09f9c1eefb8dffba779570da390bd7e8102ebcd5 (diff)
downloadgcc-d11c9841d54ed74978f8d0e0f352631f90504dd5.zip
gcc-d11c9841d54ed74978f8d0e0f352631f90504dd5.tar.gz
gcc-d11c9841d54ed74978f8d0e0f352631f90504dd5.tar.bz2
Add missing check for gassign.
gcc/ChangeLog: * tree-vect-generic.c (expand_vector_condition): Check for gassign before inspecting RHS.
-rw-r--r--gcc/tree-vect-generic.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-vect-generic.c b/gcc/tree-vect-generic.c
index fb955bb..83d399a 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<gassign *> (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);