Commit e4c73066 by Richard Biener Committed by Richard Biener

re PR tree-optimization/84204 ([graphite] ICE in set_codegen_error, at…

re PR tree-optimization/84204 ([graphite] ICE in set_codegen_error, at graphite-isl-ast-to-gimple.c:206)

2018-02-07  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/84204
	* tree-chrec.c (chrec_fold_plus_1): Remove size limiting in
	this place.

	* gcc.dg/graphite/pr84204.c: New testcase.

	PR tree-optimization/84205
	* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Also
	special-case isl_ast_op_zdiv_r.

	* gcc.dg/graphite/pr84205.c: New testcase.

	PR tree-optimization/84223
	* graphite-scop-detection.c (gather_bbs::before_dom_children):
	Only add conditions from within the region.
	(gather_bbs::after_dom_children): Adjust.

	* gfortran.dg/graphite/pr84223.f90: New testcase.

From-SVN: r257441
parent 3924c9be
2018-02-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/84204
* tree-chrec.c (chrec_fold_plus_1): Remove size limiting in
this place.
PR tree-optimization/84205
* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Also
special-case isl_ast_op_zdiv_r.
PR tree-optimization/84223
* graphite-scop-detection.c (gather_bbs::before_dom_children):
Only add conditions from within the region.
(gather_bbs::after_dom_children): Adjust.
2018-02-07 Georg-Johann Lay <avr@gjlay.de>
PR target/84209
......
......@@ -327,6 +327,7 @@ binary_op_to_tree (tree type, __isl_take isl_ast_expr *expr, ivs_params &ip)
we cannot represent explicitely but that are no-ops for TYPE.
Elide those. */
if ((expr_type == isl_ast_op_pdiv_r
|| expr_type == isl_ast_op_zdiv_r
|| expr_type == isl_ast_op_add)
&& isl_ast_expr_get_type (arg_expr) == isl_ast_expr_int
&& (wi::exact_log2 (widest_int_from_isl_expr_int (arg_expr))
......
......@@ -1453,18 +1453,19 @@ gather_bbs::before_dom_children (basic_block bb)
}
}
gcond *stmt = single_pred_cond_non_loop_exit (bb);
if (stmt)
if (gcond *stmt = single_pred_cond_non_loop_exit (bb))
{
edge e = single_pred_edge (bb);
conditions.safe_push (stmt);
if (e->flags & EDGE_TRUE_VALUE)
cases.safe_push (stmt);
else
cases.safe_push (NULL);
/* Make sure the condition is in the region and thus was verified
to be handled. */
if (e != region->region.entry)
{
conditions.safe_push (stmt);
if (e->flags & EDGE_TRUE_VALUE)
cases.safe_push (stmt);
else
cases.safe_push (NULL);
}
}
scop->scop_info->bbs.safe_push (bb);
......@@ -1509,8 +1510,12 @@ gather_bbs::after_dom_children (basic_block bb)
if (single_pred_cond_non_loop_exit (bb))
{
conditions.pop ();
cases.pop ();
edge e = single_pred_edge (bb);
if (e != scop->scop_info->region.entry)
{
conditions.pop ();
cases.pop ();
}
}
}
......
2018-02-07 Richard Biener <rguenther@suse.de>
PR tree-optimization/84204
* gcc.dg/graphite/pr84204.c: New testcase.
PR tree-optimization/84205
* gcc.dg/graphite/pr84205.c: New testcase.
PR tree-optimization/84223
* gfortran.dg/graphite/pr84223.f90: New testcase.
2018-02-07 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/71662
......
/* { dg-do compile } */
/* { dg-options "-O -floop-parallelize-all -fno-tree-loop-im --param scev-max-expr-size=3" } */
int oc;
void
mo (int xd)
{
while (xd < 1)
{
for (oc = 0; oc < 2; ++oc)
{
}
++xd;
}
}
/* { dg-do compile } */
/* { dg-options "-O -floop-nest-optimize -ftree-pre -fno-tree-loop-im" } */
long long unsigned int od;
int zj, fk, ea;
void
ke (void)
{
if (od != 0 && zj != 0)
{
for (fk = 0; fk < 2; ++fk)
{
}
if (od == (long long unsigned int) zj)
zj = 0;
for (ea = 0; ea < 2; ++ea)
{
}
}
}
! { dg-do compile }
! { dg-options "-fgraphite-identity -O1 --param sccvn-max-alias-queries-per-access=0" }
include "../assumed_rank_bounds_2.f90"
......@@ -375,12 +375,10 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
default:
{
int size = 0;
if ((tree_contains_chrecs (op0, &size)
|| tree_contains_chrecs (op1, &size))
&& size < PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
if (tree_contains_chrecs (op0, NULL)
|| tree_contains_chrecs (op1, NULL))
return build2 (code, type, op0, op1);
else if (size < PARAM_VALUE (PARAM_SCEV_MAX_EXPR_SIZE))
else
{
if (code == POINTER_PLUS_EXPR)
return fold_build_pointer_plus (fold_convert (type, op0),
......@@ -390,8 +388,6 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
fold_convert (type, op0),
fold_convert (type, op1));
}
else
return chrec_dont_know;
}
}
}
......
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