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]

PATCH: allow inlining of `void' functions



Kenner's recent change correctly made TYPE_SIZE_UNIT be NULL for
`void'.

However, that caused a failure in g++.warn/inline.C; it turns out that
Kenner's change caused us to stop inlining functions that return void.

The obvious fix is attached.

--
Mark Mitchell                   mark@codesourcery.com
CodeSourcery, LLC               http://www.codesourcery.com

2000-03-26  Mark Mitchell  <mark@codesourcery.com>

	* integrate.c (function_cannot_inline_p): Do inline functions that
	return `void'.

Index: integrate.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/integrate.c,v
retrieving revision 1.98
diff -c -p -r1.98 integrate.c
*** integrate.c	2000/03/25 18:34:02	1.98
--- integrate.c	2000/03/26 19:04:10
*************** function_cannot_inline_p (fndecl)
*** 186,192 ****
      return N_("inline functions not supported for this return value type");
  
    /* We can't inline functions that return structures of varying size.  */
!   if (int_size_in_bytes (TREE_TYPE (TREE_TYPE (fndecl))) < 0)
      return N_("function with varying-size return value cannot be inline");
  
    /* Cannot inline a function with a varying size argument or one that
--- 186,193 ----
      return N_("inline functions not supported for this return value type");
  
    /* We can't inline functions that return structures of varying size.  */
!   if (TREE_CODE (TREE_TYPE (TREE_TYPE (fndecl))) != VOID_TYPE
!       && int_size_in_bytes (TREE_TYPE (TREE_TYPE (fndecl))) < 0)
      return N_("function with varying-size return value cannot be inline");
  
    /* Cannot inline a function with a varying size argument or one that

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