This is the mail archive of the gcc@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]

Re: Inefficient code generation with -fPIC.


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.

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