This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Inefficient code generation with -fPIC.
- To: suckfish at ihug dot co dot nz
- Subject: Re: Inefficient code generation with -fPIC.
- From: Joe Buck <jbuck at synopsys dot COM>
- Date: Mon, 13 Nov 2000 12:26:04 -0800 (PST)
- Cc: gcc at gcc dot gnu dot org
I wrote:
> >If a function specifies throw() and calls other functions, it has to
> >add a handler to catch throws from these other functions, so perhaps
> >this is the source of the extra code. But in this case f() does not
> >call any other functions, so I don't understand why it has an effect here.
Ralph writes:
> The code that adds the handler is at the end of store_parm_decls, and in
> finish_function, both in cp/decl.c. [Always adding it at this stage seems
> reasonable - definitive information as to whether or not it is needed
> presumably won't be available at this stage.]
It used to be that the C++ front end, like the C front end, translated
a statement at a time into RTL. But now we form the whole tree first,
complete with inlining, so more information is available early on (e.g.
whether or not a function is called that might throw).
Since this code is still new, not much has been done to take advantage of it.
But we could do better here.