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: PR C++/11131 and PR C/10320


> 	Testcase gcc.c-torture/execute/20030718-1.c has started failing on
> AIX beginning last night.
It was a latent bug in tree_inlinable_p mistakely masked by my
unit-at-a-time bug.  I am attaching the fix.
In short when function was not inlinable because function body were
missing, the DECL_UNINLINABLE was set and function was not inlined even
even once the body arrived.  This in addition confused another hack in
c-decl trying to deffer for inlining uninliniable functions just to see
them elliminated when they are unused.

I am currently testing the attached patch.
Honza

Wed Jul 30 18:05:30 CEST 2003  Jan Hubicka  <jh@suse.cz>
	* tree-inline.c (inlinable_function_p): Don't set DECL_UNINLINABLE just
	because function body is missing.

Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.71
diff -c -3 -p -r1.71 tree-inline.c
*** tree-inline.c	29 Jul 2003 17:42:34 -0000	1.71
--- tree-inline.c	30 Jul 2003 16:05:18 -0000
*************** inlinable_function_p (tree fn, inline_da
*** 948,953 ****
--- 948,958 ----
       in C++ it may result in template instantiation.)  */
    inlinable = !(*lang_hooks.tree_inlining.cannot_inline_tree_fn) (&fn);
  
+   /* If we don't have the function body available, we can't inline
+      it.  */
+   if (! DECL_SAVED_TREE (fn))
+     return 0;
+ 
    /* We may be here either because fn is declared inline or because
       we use -finline-functions.  For the second case, we are more
       restrictive.  */
*************** inlinable_function_p (tree fn, inline_da
*** 1026,1036 ****
  	    inlinable = 0;
  	}
      }
- 
-   /* If we don't have the function body available, we can't inline
-      it.  */
-   if (! DECL_SAVED_TREE (fn))
-     inlinable = 0;
  
    /* Check again, language hooks may have modified it.  */
    if (! inlinable || DECL_UNINLINABLE (fn))
--- 1031,1036 ----


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