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]

Re: i386 PIC improvement for static functions.


> I'm also not sure you need a new tree flag -- I think TREE_ADDRESSABLE
> does what you want.

TREE_ADDRESSABLE appears to be set in some situations which don't
require loading the pic register.  For example expand_call has:

         else if (! TREE_ADDRESSABLE (fndecl))
            {
              /* In case this function later becomes inlinable,
                 record that there was already a non-inline call to it.

                 Use abstraction instead of setting TREE_ADDRESSABLE
                 directly.  */
              if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline
                  && optimize > 0)
                {
                  warning_with_decl (fndecl, "can't inline call to `%s'");
                  warning ("called from here");
                }
              mark_addressable (fndecl);
            }

and:

      /* If inlining failed, mark FNDECL as needing to be compiled
         separately after all.  If function was declared inline,
         give a warning.  */
      if (DECL_INLINE (fndecl) && warn_inline && !flag_no_inline
          && optimize > 0 && ! TREE_ADDRESSABLE (fndecl))
        {
          warning_with_decl (fndecl, "inlining failed in call to `%s'");
          warning ("called from here");
        }
      mark_addressable (fndecl);

-- John
-------------------------------------------------------------------------
|   Feith Systems  |   Voice: 1-215-646-8000  |  Email: john@feith.com  |
|    John Wehle    |     Fax: 1-215-540-5495  |                         |
-------------------------------------------------------------------------



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