This is the mail archive of the
mailing list for the GCC project.
Re: genattrtab speedup 4/4
- From: "Kaveh R. GHAZI" <ghazi at caip dot rutgers dot edu>
- To: Richard Guenther <richard dot guenther at gmail dot com>
- Cc: Michael Matz <matz at suse dot de>, gcc-patches at gcc dot gnu dot org
- Date: Tue, 21 Apr 2009 10:44:32 -0400 (EDT)
- Subject: Re: genattrtab speedup 4/4
- References: <Pine.LNX.firstname.lastname@example.org> <email@example.com>
On Mon, 20 Apr 2009, Richard Guenther wrote:
> Hmm. I wonder what happens to insn-attrtab.c compile-time if
> we properly mark functions in output.h as pure?
I've looked into more aggresive use of attributes pure/const on gcc
functions. The problem I recall running into is that for whatever
function you want to start with, you have to perform a depth-first
conversion of all sub-functions it calls and they must be marked
pure/const also or GCC will complain (warn) during bootstrap.
That part is actually a "good thing" if you do the grunt work. However I
specifically recall running into problems with certain functions using
switch statements that had a default clause with abort or gcc_unreachable.
Such functions aren't technically pure since aborting is a side-effect and
GCC won't allow you to mark these with the attribute. Another way
aborting sneaks in big-time is because of "checking" macros which
introduce lots of noreturn calls.
This was discussed a while back, and some solutions were thrown around but
I don't have the relevant URLs handy. I think one of the ideas was
introducing a new function attribute that meant "I'm sort of pure but I
might not return". I don't know how much that would help for performance.
Another annoyance is that many of the relevant functions here, especially
in insn-*.c are filled with target dependent code. So the depth-first
conversion must be done across all targets to ensure it doesn't break
bootstrap somewhere when you add the attribute.