This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patches to remove TREE_COMPLEXITY for C and C++


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]