summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-reassoc.c
diff options
context:
space:
mode:
authorjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-12 11:11:40 +0000
committerjakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>2009-01-12 11:11:40 +0000
commit3a43bfe92a316520f682bf513990bbd8b8942854 (patch)
tree203935620a9c02e05010b2cbf1b3c8f3d04c7d50 /gcc/tree-ssa-reassoc.c
parent95fb59aaf5a1e2c5e0d30cea1a6331272c40c107 (diff)
downloadgcc-3a43bfe92a316520f682bf513990bbd8b8942854.tar.gz
PR tree-optimization/38807
* tree-ssa-reassoc.c (remove_visited_stmt_chain): Don't look at gimple_visited_p unless stmt is GIMPLE_ASSIGN. * gcc.c-torture/compile/pr38807.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@143289 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-reassoc.c')
-rw-r--r--gcc/tree-ssa-reassoc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c
index d539398c5c7..d28e1b620ff 100644
--- a/gcc/tree-ssa-reassoc.c
+++ b/gcc/tree-ssa-reassoc.c
@@ -1,5 +1,5 @@
/* Reassociation for trees.
- Copyright (C) 2005, 2007, 2008 Free Software Foundation, Inc.
+ Copyright (C) 2005, 2007, 2008, 2009 Free Software Foundation, Inc.
Contributed by Daniel Berlin <dan@dberlin.org>
This file is part of GCC.
@@ -1279,7 +1279,8 @@ remove_visited_stmt_chain (tree var)
if (TREE_CODE (var) != SSA_NAME || !has_zero_uses (var))
return;
stmt = SSA_NAME_DEF_STMT (var);
- if (!gimple_visited_p (stmt))
+ if (!is_gimple_assign (stmt)
+ || !gimple_visited_p (stmt))
return;
var = gimple_assign_rhs1 (stmt);
gsi = gsi_for_stmt (stmt);