This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix PR37181, oversight with last vrp patch
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2008 13:24:46 +0200 (CEST)
- Subject: [PATCH] Fix PR37181, oversight with last vrp patch
Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk.
Richard.
2008-08-21 Richard Guenther <rguenther@suse.de>
PR tree-optimization/37181
* tree-vrp.c (extract_range_from_binary_expr): Check for NULL
folding result.
(extract_range_from_unary_expr): Likewise.
Index: gcc/tree-vrp.c
===================================================================
*** gcc/tree-vrp.c (revision 139372)
--- gcc/tree-vrp.c (working copy)
*************** extract_range_from_binary_expr (value_ra
*** 2062,2068 ****
&& (op1 = op_with_constant_singleton_value_range (op1)) != NULL_TREE)
{
tree tem = fold_binary (code, expr_type, op0, op1);
! if (is_gimple_min_invariant (tem)
&& !is_overflow_infinity (tem))
{
set_value_range (vr, VR_RANGE, tem, tem, NULL);
--- 2062,2069 ----
&& (op1 = op_with_constant_singleton_value_range (op1)) != NULL_TREE)
{
tree tem = fold_binary (code, expr_type, op0, op1);
! if (tem
! && is_gimple_min_invariant (tem)
&& !is_overflow_infinity (tem))
{
set_value_range (vr, VR_RANGE, tem, tem, NULL);
*************** extract_range_from_unary_expr (value_ran
*** 2477,2483 ****
if ((op0 = op_with_constant_singleton_value_range (op0)) != NULL_TREE)
{
tree tem = fold_unary (code, type, op0);
! if (is_gimple_min_invariant (tem)
&& !is_overflow_infinity (tem))
{
set_value_range (vr, VR_RANGE, tem, tem, NULL);
--- 2478,2485 ----
if ((op0 = op_with_constant_singleton_value_range (op0)) != NULL_TREE)
{
tree tem = fold_unary (code, type, op0);
! if (tem
! && is_gimple_min_invariant (tem)
&& !is_overflow_infinity (tem))
{
set_value_range (vr, VR_RANGE, tem, tem, NULL);