Commit 6acfd18c by Richard Biener Committed by Richard Biener

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

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

2018-01-24  Richard Biener  <rguenther@suse.de>

	PR tree-optimization/83176
	* tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
	operands.

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

From-SVN: r257013
parent da37a70f
2018-01-24 Richard Biener <rguenther@suse.de> 2018-01-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/83176
* tree-chrec.c (chrec_fold_plus_1): Handle (signed T){(T) .. }
operands.
2018-01-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82819 PR tree-optimization/82819
* graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid * graphite-isl-ast-to-gimple.c (binary_op_to_tree): Avoid
code generating pluses that are no-ops in the target precision. code generating pluses that are no-ops in the target precision.
......
2018-01-24 Richard Biener <rguenther@suse.de> 2018-01-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/83176
* gcc.dg/graphite/pr83176.c: New testcase.
2018-01-24 Richard Biener <rguenther@suse.de>
PR tree-optimization/82819 PR tree-optimization/82819
* gcc.dg/graphite/pr82819.c: New testcase. * gcc.dg/graphite/pr82819.c: New testcase.
......
/* { dg-do compile } */
/* { dg-options "-O2 -floop-nest-optimize" } */
int wx, qi;
void
yj (int gw)
{
int *ak = &gw;
while (wx != 0)
{
int k2 = (__INTPTR_TYPE__)&ak;
int **xq = (int **)&k2;
ja:
*xq = &gw;
while (qi < 1)
{
unsigned short int ey;
be:
for (ey = 0; ey < 251; ++ey)
{
for (wx = 0; wx < 2; ++wx)
{
}
*ak += 8555712;
k2 += *ak;
}
++qi;
}
}
gw = 1;
if (gw != 0)
goto ja;
else
goto be;
}
...@@ -295,8 +295,23 @@ chrec_fold_plus_1 (enum tree_code code, tree type, ...@@ -295,8 +295,23 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
return chrec_fold_plus_poly_poly (code, type, op0, op1); return chrec_fold_plus_poly_poly (code, type, op0, op1);
CASE_CONVERT: CASE_CONVERT:
{
/* We can strip sign-conversions to signed by performing the
operation in unsigned. */
tree optype = TREE_TYPE (TREE_OPERAND (op1, 0));
if (INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (optype)
&& tree_nop_conversion_p (type, optype)
&& TYPE_UNSIGNED (optype))
return chrec_convert (type,
chrec_fold_plus_1 (code, optype,
chrec_convert (optype,
op0, NULL),
TREE_OPERAND (op1, 0)),
NULL);
if (tree_contains_chrecs (op1, NULL)) if (tree_contains_chrecs (op1, NULL))
return chrec_dont_know; return chrec_dont_know;
}
/* FALLTHRU */ /* FALLTHRU */
default: default:
...@@ -313,8 +328,23 @@ chrec_fold_plus_1 (enum tree_code code, tree type, ...@@ -313,8 +328,23 @@ chrec_fold_plus_1 (enum tree_code code, tree type,
} }
CASE_CONVERT: CASE_CONVERT:
{
/* We can strip sign-conversions to signed by performing the
operation in unsigned. */
tree optype = TREE_TYPE (TREE_OPERAND (op0, 0));
if (INTEGRAL_TYPE_P (type)
&& INTEGRAL_TYPE_P (optype)
&& tree_nop_conversion_p (type, optype)
&& TYPE_UNSIGNED (optype))
return chrec_convert (type,
chrec_fold_plus_1 (code, optype,
TREE_OPERAND (op0, 0),
chrec_convert (optype,
op1, NULL)),
NULL);
if (tree_contains_chrecs (op0, NULL)) if (tree_contains_chrecs (op0, NULL))
return chrec_dont_know; return chrec_dont_know;
}
/* FALLTHRU */ /* FALLTHRU */
default: default:
......
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