re PR tree-optimization/26361 (bootstrap failure on Alpha: xgcc runs out of memory compiling libiberty/md5.c)

PR tree-optimization/26361
	* tree-vrp.c (extract_range_from_unary_expr): Handle NEGATE_EXPR
	of unsigned integer types.

	* gcc.dg/tree-ssa/vrp27.c: New test case.

From-SVN: r111327
This commit is contained in:
Roger Sayle 2006-02-21 02:28:03 +00:00 committed by Roger Sayle
parent f49712d833
commit c1a70a3c1e
4 changed files with 62 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2006-02-20 Roger Sayle <roger@eyesopen.com>
PR tree-optimization/26361
* tree-vrp.c (extract_range_from_unary_expr): Handle NEGATE_EXPR
of unsigned integer types.
2006-02-20 Sebastian Pop <pop@cri.ensmp.fr>
* tree-chrec.c (eq_evolutions_p): New.

View file

@ -1,3 +1,8 @@
2006-02-20 Roger Sayle <roger@eyesopen.com>
PR tree-optimization/26361
* gcc.dg/tree-ssa/vrp27.c: New test case.
2006-02-20 Andrew Pinski <pinskia@physics.uc.edu>
* gcc.dg/tree-ssa/complex-3.c: Split out first part into ...

View file

@ -0,0 +1,33 @@
/* PR middle-end/26361. */
/* { dg-do run } */
/* { dg-options "-O2" } */
void abort(void);
__attribute__((noinline))
void gen_rtx_CONST_INT(long long x) {
if (-x > 10)
abort();
}
__attribute__((noinline))
int alpha_expand_prologue(long frame_size)
{
unsigned long long a;
int probed;
if (frame_size <= 1) return;
unsigned long long b = -2;
a = -2;
do {
int a1 = a;
probed = -a1;
gen_rtx_CONST_INT (a1);
a -= 2;
a1 = -a;
probed = a1;
} while (probed < frame_size);
}
int main(void) {
alpha_expand_prologue(10);
return 0;
}

View file

@ -1790,6 +1790,24 @@ extract_range_from_unary_expr (value_range_t *vr, tree expr)
max = (vr0.min == TYPE_MIN_VALUE (TREE_TYPE (expr)) && !flag_wrapv)
? TYPE_MAX_VALUE (TREE_TYPE (expr))
: fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
}
else if (code == NEGATE_EXPR
&& TYPE_UNSIGNED (TREE_TYPE (expr)))
{
if (!range_includes_zero_p (&vr0))
{
max = fold_unary_to_constant (code, TREE_TYPE (expr), vr0.min);
min = fold_unary_to_constant (code, TREE_TYPE (expr), vr0.max);
}
else
{
if (range_is_null (&vr0))
set_value_range_to_null (vr, TREE_TYPE (expr));
else
set_value_range_to_varying (vr);
return;
}
}
else if (code == ABS_EXPR
&& !TYPE_UNSIGNED (TREE_TYPE (expr)))