This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[Committed] Clean-up TREE_OVERFLOW usage in middle-end
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sun, 15 May 2005 22:37:49 -0600 (MDT)
- Subject: [Committed] Clean-up TREE_OVERFLOW usage in middle-end
I've decided to commit the following hunks to CVS mainline. These
middle-end changes were formerly part of a larger "global" patch
at http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02412.html
There's no point pinging (bits of) patches against parts of the
compiler I can maintain.
The following patch has been tested on i686-pc-linux-gnu with a
full "make bootstrap", all default languages, and regression tested
with a top-level "make -k check" with no new failures.
Committed to mainline CVS.
2005-05-15 Roger Sayle <roger@eyesopen.com>
* tree-scalar-evolution.c (set_nb_iterations_in_loop): Only
check for TREE_OVERFLOW on INTEGER_CST trees.
* tree-chrec.c (chrec_convert): Only clear TREE_OVERFLOW on
CONSTANT_CLASS_P tree nodes.
Index: tree-scalar-evolution.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-scalar-evolution.c,v
retrieving revision 2.23
diff -c -3 -p -r2.23 tree-scalar-evolution.c
*** tree-scalar-evolution.c 2 May 2005 08:56:52 -0000 2.23
--- tree-scalar-evolution.c 15 May 2005 22:56:26 -0000
*************** set_nb_iterations_in_loop (struct loop *
*** 922,929 ****
count of the loop in order to be compatible with the other
nb_iter computations in loop-iv. This also allows the
representation of nb_iters that are equal to MAX_INT. */
! if ((TREE_CODE (res) == INTEGER_CST && TREE_INT_CST_LOW (res) == 0)
! || TREE_OVERFLOW (res))
res = chrec_dont_know;
if (dump_file && (dump_flags & TDF_DETAILS))
--- 922,930 ----
count of the loop in order to be compatible with the other
nb_iter computations in loop-iv. This also allows the
representation of nb_iters that are equal to MAX_INT. */
! if (TREE_CODE (res) == INTEGER_CST
! && (TREE_INT_CST_LOW (res) == 0
! || TREE_OVERFLOW (res)))
res = chrec_dont_know;
if (dump_file && (dump_flags & TDF_DETAILS))
Index: tree-chrec.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-chrec.c,v
retrieving revision 2.15
diff -c -3 -p -r2.15 tree-chrec.c
*** tree-chrec.c 21 Apr 2005 08:48:51 -0000 2.15
--- tree-chrec.c 15 May 2005 22:56:26 -0000
*************** chrec_convert (tree type,
*** 1062,1070 ****
tree res = fold_convert (type, chrec);
/* Don't propagate overflows. */
- TREE_OVERFLOW (res) = 0;
if (CONSTANT_CLASS_P (res))
! TREE_CONSTANT_OVERFLOW (res) = 0;
/* But reject constants that don't fit in their type after conversion.
This can happen if TYPE_MIN_VALUE or TYPE_MAX_VALUE are not the
--- 1062,1072 ----
tree res = fold_convert (type, chrec);
/* Don't propagate overflows. */
if (CONSTANT_CLASS_P (res))
! {
! TREE_CONSTANT_OVERFLOW (res) = 0;
! TREE_OVERFLOW (res) = 0;
! }
/* But reject constants that don't fit in their type after conversion.
This can happen if TYPE_MIN_VALUE or TYPE_MAX_VALUE are not the
Roger
--