re PR tree-optimization/32453 (ICE in build2_stat, at tree.c:3074 (extract_range_from_assert))

2007-06-21  Richard Guenther  <rguenther@suse.de>

	PR tree-optimization/32453
	* tree-vrp.c (extract_range_from_assert): Build POINTER_PLUS_EXPR
	for pointer anti-range.

	* gcc.c-torture/compile/pr32453.c: New testcase.

From-SVN: r125922
This commit is contained in:
Richard Guenther 2007-06-21 14:54:47 +00:00 committed by Richard Biener
parent 461a73b578
commit 4228997795
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2007-06-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32453
* tree-vrp.c (extract_range_from_assert): Build POINTER_PLUS_EXPR
for pointer anti-range.
2007-06-21 H.J. Lu <hongjiu.lu@intel.com>
* config/i386/i386.c (processor_target_table): Increase maximum

View File

@ -1,3 +1,8 @@
2007-06-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/32453
* gcc.c-torture/compile/pr32453.c: New testcase.
2007-06-21 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/31866

View File

@ -0,0 +1,11 @@
void ucs2reverse_internal_loop_single (long *irreversible, int foo)
{
unsigned char bytebuf[2];
const unsigned char *inptr = bytebuf;
if (irreversible == (void *)0)
;
else
inptr += 2;
if (inptr != bytebuf)
((inptr - bytebuf > foo) ? (void) (0) : __assert_fail ());
}

View File

@ -1473,10 +1473,13 @@ extract_range_from_assert (value_range_t *vr_p, tree expr)
}
min = positive_overflow_infinity (TREE_TYPE (var_vr->min));
}
else
else if (!POINTER_TYPE_P (TREE_TYPE (var_vr->min)))
min = fold_build2 (PLUS_EXPR, TREE_TYPE (var_vr->min),
anti_max,
build_int_cst (TREE_TYPE (var_vr->min), 1));
else
min = fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (var_vr->min),
anti_max, size_int (1));
max = real_max;
set_value_range (vr_p, VR_RANGE, min, max, vr_p->equiv);
}