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]

PR22379


Hi,
the early inlining is working on topological order of functions and it is not
inlining recursively.  As such it might miss always_inline in a case the
inlined function comes later in cyclic graph.  I think there is no need to
introduce recursion here as it is quite rare occasion in cases early inlining
is implemented for so it is better to warn only after real inlining.

Bootstrapped/regtested i686-pc-gnu-linux. I think it quallifies as
obvious but I will be able to commit it only after 10th probably.

void __add_entropy_words(void);
void __wake_up(void);
void SHATransform(void);
static inline __attribute__((always_inline)) void add_entropy_words(void){}
void extract_entropy(void);
static inline __attribute__((always_inline)) void xfer_secondary_pool(void)
{
extract_entropy();
add_entropy_words();
}
void extract_entropy(void)
{
xfer_secondary_pool();
__wake_up();
}
void init_std_data(void)
{
add_entropy_words();
}
void rand_initialize(void)
{
init_std_data();
}

2005-07-09  Jan Hubicka  <jh@suse.cz>
	PR tree-optimize/22379
	* tree-inline.c (expand_call_inline): Do not output sorry in early
	inlining.

Index: tree-inline.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v
retrieving revision 1.199
diff -c -3 -p -r1.199 tree-inline.c
*** tree-inline.c	28 Jun 2005 02:20:28 -0000	1.199
--- tree-inline.c	8 Jul 2005 22:40:46 -0000
*************** expand_call_inline (basic_block bb, tree
*** 1961,1967 ****
       inlining.  */
    if (!cgraph_inline_p (cg_edge, &reason))
      {
!       if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
  	{
  	  sorry ("%Jinlining failed in call to %qF: %s", fn, fn, reason);
  	  sorry ("called from here");
--- 1961,1969 ----
       inlining.  */
    if (!cgraph_inline_p (cg_edge, &reason))
      {
!       if (lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn))
! 	  /* Avoid warnings during early inline pass. */
! 	  && (!flag_unit_at_a_time || cgraph_global_info_ready))
  	{
  	  sorry ("%Jinlining failed in call to %qF: %s", fn, fn, reason);
  	  sorry ("called from here");


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