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: [PATCH][C] Fix GNU extern inline heuristic again (fix C++ memory usage regression)


Richard Guenther <rguenther@suse.de> writes:

> +   /* For GNU C extern inline functions disregard inline limits.  */
> +   if (DECL_EXTERNAL (fndecl) 
> +       && DECL_DECLARED_INLINE_P (fndecl))
> +     DECL_DISREGARD_INLINE_LIMITS (fndecl) = 1;

You may have found a bug here.  I see that you are just replicating
the existing code.  But a GNU C extern inline function is not the same
as a C99 extern inline function.  I don't see any obvious reason why
we should disregard inline limits for a C99 extern inline function.


*************** handle_always_inline_attribute (tree *no
*** 4864,4871 ****
  {
    if (TREE_CODE (*node) == FUNCTION_DECL)
      {
!       /* Do nothing else, just set the attribute.  We'll get at
! 	 it later with lookup_attribute.  */
      }
    else
      {
--- 4864,4872 ----
  {
    if (TREE_CODE (*node) == FUNCTION_DECL)
      {
!       /* Set the attribute and mark it for disregarding inline
! 	 limits.  */
!       DECL_DISREGARD_INLINE_LIMITS (*node) = 1;
      }
    else
      {


Is there any reason to keep the attribute, if we are setting the flag?
That is, why not set *no_add_attrs = true?

Ian


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