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: genattrtab speedup 4/4


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.

		--Kaveh


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