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: add mips long_call attribute


On Fri, 2005-07-29 at 23:52, Richard Sandiford wrote:
> I don't see the need for this.  Why not just check the SYMBOL_REF_DECL
> directly in const_call_insn_operand?

I'm not sure if this is safe.  There are a lot of places that copy rtl
around, and I'm not sure that all of them will properly set and/or
preserve the SYMBOL_REF_DECL field.  The comment for SYMBOL_REF_FLAGS in
rtl.h even suggests that relying on the decl is not safe in all cases.

This is the same way we handle similar features, such as TLS support and
small data.  There are quite a few ports that do things this way.

I think the lookup_attribute call will be expensive.  I was thinking
that putting it in mips_encode_section_info would be more efficient than
putting it in const_call_insn_operand.  mips_encode_section_info only
gets called once (normally) per decl.  const_call_insn_operand gets
called everytime we recog a CALL_INSN.  However, I haven't tried
measuring this.  Also, I wasn't thinking about C++ header files that
declare the world.  Maybe mips_encode_section_info is better for typical
C code, but not for typical C++ code.
-- 
Jim Wilson, GNU Tools Support, http://www.specifix.com


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