Commit 730e78b0 by Richard Biener Committed by Richard Biener

re PR c++/60836 (invalid PHI argument and ICE in verify_gimple)

2014-04-17  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/60836
	* tree-vect-loop.c (vect_create_epilog_for_reduction): Force
	initial PHI args to be gimple values.

	* g++.dg/vect/pr60836.cc: New testcase.

From-SVN: r209468
parent 1428105c
2014-04-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/60836
* tree-vect-loop.c (vect_create_epilog_for_reduction): Force
initial PHI args to be gimple values.
2014-04-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/60841
......
2014-04-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/60836
* g++.dg/vect/pr60836.cc: New testcase.
2014-04-17 Richard Biener <rguenther@suse.de>
PR tree-optimization/60841
......
// { dg-do compile }
int a, b;
typedef double (*NormFunc) (const int &);
int &
max (int &p1, int &p2)
{
if (p1 < p2)
return p2;
return p1;
}
struct A
{
int operator () (int p1, int p2)
{
return max (p1, p2);
}
};
template < class, class > double
norm_ (const int &)
{
char c, d;
A e;
for (; a; a++)
{
b = e (b, d);
b = e (b, c);
}
}
void
norm ()
{
static NormFunc f = norm_ < int, A >;
f = 0;
}
// { dg-final { cleanup-tree-dump "vect" } }
......@@ -3952,8 +3952,12 @@ vect_create_epilog_for_reduction (vec<tree> vect_defs, gimple stmt,
/* Set phi nodes arguments. */
FOR_EACH_VEC_ELT (reduction_phis, i, phi)
{
tree vec_init_def = vec_initial_defs[i];
tree def = vect_defs[i];
tree vec_init_def, def;
gimple_seq stmts;
vec_init_def = force_gimple_operand (vec_initial_defs[i], &stmts,
true, NULL_TREE);
gsi_insert_seq_on_edge_immediate (loop_preheader_edge (loop), stmts);
def = vect_defs[i];
for (j = 0; j < ncopies; j++)
{
/* Set the loop-entry arg of the reduction-phi. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment