This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patches to remove TREE_COMPLEXITY for C and C++
- From: Mark Mitchell <mark at codesourcery dot com>
- To: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- Cc: gcc-patches at gcc dot gnu dot org, stevenb at suse dot de
- Date: Sun, 18 Jul 2004 16:39:28 -0700
- Subject: Re: Patches to remove TREE_COMPLEXITY for C and C++
- Organization: CodeSourcery, LLC
- References: <Pine.LNX.4.58.0407181944080.31862@digraph.polyomino.org.uk>
Joseph S. Myers wrote:
This pair of patches removes the use of TREE_COMPLEXITY for C and C++.
It doesn't get rid of TREE_COMPLEXITY altogether, since I hadn't
realised that Java was still using it but using the complexity field
directly rather than through the TREE_COMPLEXITY accessor. Thus, Java
and Ada are left as the only users of this field.
That's too bad -- saving four bytes per expression would not be
insignificant. After a quick look, though, I don't see a dead-simple
way of changing Java, and I haven't looked at Ada.
MODIFY_EXPR and so not trigger the warning. At present a proper
implementation for C++ would require moving the warning out of
c_common_truthvalue_conversion into language-specific code for each
front end, called at the syntactically appropriate points.
That's probably the right solution (it should be easy to implement this
warning directly in the C++ parser, for example) -- but your changes are
clearly an improvement over the status quo.
Accordingly I request review of (a) patch 1, so Steven Bosscher can
apply that; (b) the C++ and Objective-C parts of patch 2.
Both are OK.
--
Mark Mitchell
CodeSourcery, LLC
(916) 791-8304
mark@codesourcery.com