i386 PIC improvement for static functions.

John Wehle john@feith.com
Thu Jun 25 12:05:00 GMT 1998


> 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  |                         |
-------------------------------------------------------------------------




More information about the Gcc-patches mailing list