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
This commit is contained in:
Richard Guenther 2009-04-04 09:30:34 +00:00 committed by Richard Biener
parent 462f32622d
commit cd15ad3e60
4 changed files with 25 additions and 1 deletions

View File

@ -1,3 +1,10 @@
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.
2009-04-03 Jason Merrill <jason@redhat.com>
* stor-layout.c (set_sizetype): Set TYPE_CANONICAL.

View File

@ -1,3 +1,8 @@
2009-04-04 Richard Guenther <rguenther@suse.de>
PR tree-optimization/39636
* gcc.c-torture/compile/pr39636.c: New testcase.
2009-04-03 H.J. Lu <hongjiu.lu@intel.com>
PR rtl-optimization/39607

View File

@ -0,0 +1,11 @@
typedef float real;
typedef real rvec[3];
void calc_dx2dx(real *, real *);
void phi_sr(int nj,rvec x[],int k)
{
int i,j;
for(i=0; (i<nj-1); i++)
for(j=i+1; (j<nj); j++)
if (k)
calc_dx2dx(x[i],x[j]);
}

View File

@ -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))
{