aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-forwprop.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2009-04-04 09:30:34 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2009-04-04 09:30:34 +0000
commitcd15ad3e604aaa74991b72dcbf74ab61fe2fc9c4 (patch)
tree1617183c57efeb10cdd2fb7fe0e429fd90f87af2 /gcc/tree-ssa-forwprop.c
parent462f32622d5f7ba2efef6d145e57c41053178c38 (diff)
downloadgcc-cd15ad3e604aaa74991b72dcbf74ab61fe2fc9c4.zip
gcc-cd15ad3e604aaa74991b72dcbf74ab61fe2fc9c4.tar.gz
gcc-cd15ad3e604aaa74991b72dcbf74ab61fe2fc9c4.tar.bz2
re PR tree-optimization/39636 (ICE in gimple_assign_rhs_code, at gimple.h:1837, 435.gromacs fails to build)
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. From-SVN: r145532
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 c3e7d432..ff6bda0 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))
{