This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gcc-in-cxx] PATCH COMMITTED: Combine all tree codes into one enum
Chris Lattner <clattner@apple.com> writes:
> On Jun 19, 2008, at 12:20 PM, Ian Lance Taylor wrote:
>
>> One hassle with compiling gcc in C++ is that we casually mix enum
>> types in the frontends. This was originally done because the code
>> field in the tree type was eight bits, and there was not enough room
>> to hold all the different tree codes used by all the frontends.
>> However, the code field is now 16 bits, and there is no longer any
>> reason for the awkward tree code split.
>>
>> I have committed this patch to the gcc-in-cxx branch to generate a
>> single set of tree codes across all the frontends. I am testing this
>> patch for mainline.
>
> Does this cause any compile-time slowdown? One impact of this is that
> it will make switch statement jump tables more sparse, and may cause
> them to drop down to branch trees.
I haven't measured, but I would expect that any effect from that would
be quite small. The only frontend which defines a noticeable number
of tree codes is the C++ one. As it happens, the value of the C++
codes will only change if --enable-languages includes ada (in which
case the values of the C++ codes will increase by nine).
This patch won't affect the middle-end, of course, as that does not
use any front-end specific codes. The values of the basic codes are
unchanged. This patch can only affect the frontends.
Ian