re PR tree-optimization/55022 (air.f90 is miscompliled with -m64 -O2 -fgraphite-identity after revision 190619)

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

	PR middle-end/55022
	* fold-const.c (negate_expr_p): Don't negate directional rounding
	division.
	(fold_negate_expr): Likewise.

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

From-SVN: r209356
This commit is contained in:
Richard Biener 2014-04-14 08:11:08 +00:00 committed by Richard Biener
parent 033aa406ca
commit a3c77ce941
4 changed files with 39 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2014-04-14 Richard Biener <rguenther@suse.de>
PR middle-end/55022
* fold-const.c (negate_expr_p): Don't negate directional rounding
division.
(fold_negate_expr): Likewise.
2014-04-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/59817

View File

@ -484,8 +484,6 @@ negate_expr_p (tree t)
case TRUNC_DIV_EXPR:
case ROUND_DIV_EXPR:
case FLOOR_DIV_EXPR:
case CEIL_DIV_EXPR:
case EXACT_DIV_EXPR:
/* In general we can't negate A / B, because if A is INT_MIN and
B is 1, we may turn this into INT_MIN / -1 which is undefined
@ -682,8 +680,6 @@ fold_negate_expr (location_t loc, tree t)
case TRUNC_DIV_EXPR:
case ROUND_DIV_EXPR:
case FLOOR_DIV_EXPR:
case CEIL_DIV_EXPR:
case EXACT_DIV_EXPR:
/* In general we can't negate A / B, because if A is INT_MIN and
B is 1, we may turn this into INT_MIN / -1 which is undefined

View File

@ -1,3 +1,8 @@
2014-04-14 Richard Biener <rguenther@suse.de>
PR middle-end/55022
* gcc.dg/graphite/pr55022.c: New testcase.
2014-04-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/59817

View File

@ -0,0 +1,27 @@
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
extern void abort (void);
void __attribute__((noinline,noclone))
f(int *limit, int minLen, int maxLen)
{
int i;
for (i = minLen; i <= maxLen; i++) {
limit[i] = i;
}
}
int main()
{
int limit[256], i;
f (limit, 0, 255);
for (i = 0; i < 256; ++i)
{
if (limit[i] != i)
abort ();
__asm__ volatile ("" : : : "memory");
}
return 0;
}