This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Clean-up TREE_OVERFLOW usage in the C++ front-end
- From: Roger Sayle <roger at eyesopen dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 8 Jun 2005 16:20:15 -0600 (MDT)
- Subject: [PATCH] Clean-up TREE_OVERFLOW usage in the C++ front-end
This patch is a repost of the C++ front-end bits of my previous patch
http://gcc.gnu.org/ml/gcc-patches/2005-04/msg02412.html to clean-up
the use of TREE_OVERFLOW in the compiler. Currently, TREE_OVERFLOW
is only ever set for constant class tree codes, such as INTEGER_CST.
By restricting the testing of TREE_OVERFLOW to the appropriate tree
nodes, we can introduce stricter checking in the middle-end.
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.
Ok for mainline?
2005-06-08 Roger Sayle <roger@eyesopen.com>
* decl.c (grokdeclarator): Only check TREE_OVERFLOW on INTEGER_CST.
Index: decl.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl.c,v
retrieving revision 1.1403
diff -c -3 -p -r1.1403 decl.c
*** decl.c 3 Jun 2005 16:16:12 -0000 1.1403
--- decl.c 8 Jun 2005 17:26:57 -0000
*************** grokdeclarator (const cp_declarator *dec
*** 7449,7454 ****
--- 7449,7455 ----
if (TREE_CODE (type) == ARRAY_TYPE
&& COMPLETE_TYPE_P (type)
+ && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST
&& TREE_OVERFLOW (TYPE_SIZE (type)))
{
error ("size of array %qs is too large", name);
Roger
--