re PR tree-optimization/33576 (segfault in extract_muldiv for cpu2006 benchmark)
2007-10-03 Sebastian Pop <sebastian.pop@amd.com> PR tree-optimization/33576 * testsuite/gcc.dg/tree-ssa/pr33576.c: New. * tree-loop-linear.c (linear_transform_loops): Call remove_iv. * lambda.h (lambda_loopnest_to_gcc_loopnest): New parameter. (remove_iv): Declared. * lambda-code.c (remove_iv): Not static. (lambda_loopnest_to_gcc_loopnest): New parameter remove_ivs. Don't remove ivs there, save ivs in the buffer. From-SVN: r128986
This commit is contained in:
parent
9783a0510d
commit
05023ea487
5 changed files with 44 additions and 2 deletions
|
@ -1,3 +1,14 @@
|
|||
2007-10-03 Sebastian Pop <sebastian.pop@amd.com>
|
||||
|
||||
PR tree-optimization/33576
|
||||
* testsuite/gcc.dg/tree-ssa/pr33576.c: New.
|
||||
* tree-loop-linear.c (linear_transform_loops): Call remove_iv.
|
||||
* lambda.h (lambda_loopnest_to_gcc_loopnest): New parameter.
|
||||
(remove_iv): Declared.
|
||||
* lambda-code.c (remove_iv): Not static.
|
||||
(lambda_loopnest_to_gcc_loopnest): New parameter remove_ivs.
|
||||
Don't remove ivs there, save ivs in the buffer.
|
||||
|
||||
2007-10-03 Jason Merrill <jason@redhat.com>
|
||||
|
||||
PR c++/15764
|
||||
|
|
|
@ -1639,7 +1639,7 @@ lle_to_gcc_expression (lambda_linear_expression lle,
|
|||
|
||||
/* Remove the induction variable defined at IV_STMT. */
|
||||
|
||||
static void
|
||||
void
|
||||
remove_iv (tree iv_stmt)
|
||||
{
|
||||
if (TREE_CODE (iv_stmt) == PHI_NODE)
|
||||
|
@ -1692,6 +1692,7 @@ void
|
|||
lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
|
||||
VEC(tree,heap) *old_ivs,
|
||||
VEC(tree,heap) *invariants,
|
||||
VEC(tree,heap) **remove_ivs,
|
||||
lambda_loopnest new_loopnest,
|
||||
lambda_trans_matrix transform,
|
||||
struct obstack * lambda_obstack)
|
||||
|
@ -1861,7 +1862,7 @@ lambda_loopnest_to_gcc_loopnest (struct loop *old_loopnest,
|
|||
}
|
||||
|
||||
/* Remove the now unused induction variable. */
|
||||
remove_iv (oldiv_stmt);
|
||||
VEC_safe_push (tree, heap, *remove_ivs, oldiv_stmt);
|
||||
}
|
||||
VEC_free (tree, heap, new_ivs);
|
||||
}
|
||||
|
|
|
@ -206,8 +206,10 @@ lambda_loopnest gcc_loopnest_to_lambda_loopnest (struct loop *,
|
|||
struct obstack *);
|
||||
void lambda_loopnest_to_gcc_loopnest (struct loop *,
|
||||
VEC(tree,heap) *, VEC(tree,heap) *,
|
||||
VEC(tree,heap) **,
|
||||
lambda_loopnest, lambda_trans_matrix,
|
||||
struct obstack *);
|
||||
void remove_iv (tree);
|
||||
|
||||
static inline void lambda_vector_negate (lambda_vector, lambda_vector, int);
|
||||
static inline void lambda_vector_mult_const (lambda_vector, lambda_vector, int, int);
|
||||
|
|
20
gcc/testsuite/gcc.dg/tree-ssa/pr33576.c
Normal file
20
gcc/testsuite/gcc.dg/tree-ssa/pr33576.c
Normal file
|
@ -0,0 +1,20 @@
|
|||
/* { dg-do compile } */
|
||||
/* { dg-options "-O2 -ftree-loop-linear" } */
|
||||
|
||||
int a1[6][4][4];
|
||||
short b1[16];
|
||||
|
||||
int c1;
|
||||
void CalculateQuantParam(void)
|
||||
{
|
||||
int i, j, k, temp;
|
||||
|
||||
for(k=0; k<6; k++)
|
||||
for(j=0; j<4; j++)
|
||||
for(i=0; i<4; i++)
|
||||
{
|
||||
temp = (i<<2)+j;
|
||||
a1[k][j][i] = c1/b1[temp];
|
||||
}
|
||||
}
|
||||
|
|
@ -253,7 +253,10 @@ linear_transform_loops (void)
|
|||
loop_iterator li;
|
||||
VEC(tree,heap) *oldivs = NULL;
|
||||
VEC(tree,heap) *invariants = NULL;
|
||||
VEC(tree,heap) *remove_ivs = VEC_alloc (tree, heap, 3);
|
||||
struct loop *loop_nest;
|
||||
tree oldiv_stmt;
|
||||
unsigned i;
|
||||
|
||||
FOR_EACH_LOOP (li, loop_nest, 0)
|
||||
{
|
||||
|
@ -351,6 +354,7 @@ linear_transform_loops (void)
|
|||
}
|
||||
|
||||
lambda_loopnest_to_gcc_loopnest (loop_nest, oldivs, invariants,
|
||||
&remove_ivs,
|
||||
after, trans, &lambda_obstack);
|
||||
modified = true;
|
||||
|
||||
|
@ -363,8 +367,12 @@ linear_transform_loops (void)
|
|||
free_data_refs (datarefs);
|
||||
}
|
||||
|
||||
for (i = 0; VEC_iterate (tree, remove_ivs, i, oldiv_stmt); i++)
|
||||
remove_iv (oldiv_stmt);
|
||||
|
||||
VEC_free (tree, heap, oldivs);
|
||||
VEC_free (tree, heap, invariants);
|
||||
VEC_free (tree, heap, remove_ivs);
|
||||
scev_reset ();
|
||||
|
||||
if (modified)
|
||||
|
|
Loading…
Add table
Reference in a new issue