Add missing check for gassign.
authorMartin Liska <mliska@suse.cz>
Thu, 18 Jun 2020 07:11:31 +0000 (09:11 +0200)
committerMartin Liska <mliska@suse.cz>
Thu, 18 Jun 2020 08:09:40 +0000 (10:09 +0200)
gcc/ChangeLog:

* tree-vect-generic.c (expand_vector_condition): Check
for gassign before inspecting RHS.

gcc/tree-vect-generic.c

index fb955bbf3d2187f8df72660bfe65e05557b6d6b3..83d399a78985f2aa9faa01fb5510259fece2ae0b 100644 (file)
@@ -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);