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: [PATCH] PR19100: truthvalue_conversion vs. TREE_CONSTANT_OVERFLOW


On Tue, 21 Dec 2004, Mark Mitchell wrote:
> Roger Sayle wrote:
> > And in the Boolean comparison cases, we were destructively modifying
> > the tree in-place (which in the middle-end is generally considered a
> > bad thing).
>
> Have you measured the memory impact of this change?

My apologies for the delay, but I've now completed the requested analysis
of this patch's memory impact.  Out of the 1,403,584 calls to
c_common_thruthvalue_conversion with a comparison operator in stage2,
stage3 and the libraries of a full "make bootstrap" on i686-pc-linux-gnu,
1,402,453 (or 99.92%) already have a TREE_TYPE of truthvalue_type_node.

This makes sense as these nodes should typically be created with this
type in the C/C++ front-ends, and it's type should be preserved during
middle-end transformations.  The most common exceptions include things
like __builtin_isgreater where the comparison result (and therefore
the tree node) still have type "int" in C++ rather than "bool", etc.

So the actual increase in memory usage is negligible (1131 tree nodes
in a bootstrap), but this also helps explain why this long standing
bug of destructively modifying it's argument hasn't yet caused any
problems (that we're aware of).

Roger
--


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