Memory usage

Mike Stump mrs@wrs.com
Fri Apr 9 12:31:00 GMT 1999


> To: jakob@ostenfeld.dk
> Date: Fri, 09 Apr 1999 00:56:19 -0600
> From: Jeffrey A Law <law@upchuck.cygnus.com>

> Inlining is not always your friend.

Let me have another crack at it... before we declare inline not being
our friend...  :-)

Try the below patch (you might have to jiggle it), if it cures the
problem (so you can compiler with -O or whatever optimization flags
you used), then this is just a stupid bug in the compiler that needs
fixing that we haven't fixed yet.  Let us know if this works.

Thu Jan  7 20:33:19 1999  Mike Stump  <mrs@wrs.com>

	* integrate.c (function_cannot_inline_p): Don't inline unreasonably
	large functions, even if we say `inline'.

Doing diffs in gcc/integrate.c.~1~:
*** gcc/integrate.c.~1~	Tue Dec 15 14:13:39 1998
--- gcc/integrate.c	Thu Jan  7 20:57:05 1999
*************** function_cannot_inline_p (fndecl)
*** 120,125 ****
--- 120,129 ----
    register tree parms;
    rtx result;
  
+   /* We place a limit on even functions marked as inline.  */
+   if (DECL_INLINE (fndecl))
+     max_insns *= 100;
+ 
    /* No inlines with varargs.  */
    if ((last && TREE_VALUE (last) != void_type_node)
        || current_function_varargs)
*************** function_cannot_inline_p (fndecl)
*** 135,141 ****
      return current_function_cannot_inline;
  
    /* If its not even close, don't even look.  */
!   if (!DECL_INLINE (fndecl) && get_max_uid () > 3 * max_insns)
      return "function too large to be inline";
  
  #if 0
--- 139,145 ----
      return current_function_cannot_inline;
  
    /* If its not even close, don't even look.  */
!   if (get_max_uid () > 3 * max_insns)
      return "function too large to be inline";
  
  #if 0
*************** function_cannot_inline_p (fndecl)
*** 169,175 ****
  	return "function with transparent unit parameter cannot be inline";
      }
  
!   if (!DECL_INLINE (fndecl) && get_max_uid () > max_insns)
      {
        for (ninsns = 0, insn = get_first_nonparm_insn ();
  	   insn && ninsns < max_insns;
--- 173,179 ----
  	return "function with transparent unit parameter cannot be inline";
      }
  
!   if (get_max_uid () > max_insns)
      {
        for (ninsns = 0, insn = get_first_nonparm_insn ();
  	   insn && ninsns < max_insns;
--------------


More information about the Gcc-bugs mailing list