summaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-04 09:30:34 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-04 09:30:34 +0000
commit507b89a40e5b35898f1e0a18385f209af8bccede (patch)
tree1617183c57efeb10cdd2fb7fe0e429fd90f87af2 /gcc/tree-ssa-forwprop.c
parent4a83184b182f864e21fc3ce2999ce8a1ae1563f8 (diff)
downloadgcc-507b89a40e5b35898f1e0a18385f209af8bccede.tar.gz
2009-04-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39636 * tree-ssa-forwprop.c (forward_propagate_addr_into_variable_array_index): Check for GIMPLE_ASSIGN before accessing the rhs code. * gcc.c-torture/compile/pr39636.c: New testcase. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@145532 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-forwprop.c')
-rw-r--r--gcc/tree-ssa-forwprop.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/tree-ssa-forwprop.c b/gcc/tree-ssa-forwprop.c
index c3e7d432528..ff6bda0b1de 100644
--- a/gcc/tree-ssa-forwprop.c
+++ b/gcc/tree-ssa-forwprop.c
@@ -668,7 +668,8 @@ forward_propagate_addr_into_variable_array_index (tree offset,
tunit)) != NULL_TREE)
{
gimple offset_def2 = SSA_NAME_DEF_STMT (gimple_assign_rhs1 (offset_def));
- if (gimple_assign_rhs_code (offset_def2) == MULT_EXPR
+ if (is_gimple_assign (offset_def2)
+ && gimple_assign_rhs_code (offset_def2) == MULT_EXPR
&& TREE_CODE (gimple_assign_rhs2 (offset_def2)) == INTEGER_CST
&& tree_int_cst_equal (gimple_assign_rhs2 (offset_def2), tunit))
{