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]

PR 22574


Hi,
the testcase (I don't know how to add to testsuite as there don't seem
to be any existing IMA tests?) excercise interesting side case where
extern inline is defined in one unit and function with same name is
called in other unit.  Those two functions are really different
functions.

C frontend incorrectly unifies the decls but cgraph code knows about
that and chooses to never inline such functions that later leads to
confusion in ipa-reference.  (ie we have function that is finalized and
called but yet considered unreachable)

It would be nice if C frontend didn't unified the decls of extern inline
functions with their offline counterparts and extern inline from
different TUs, but I don't quite understand all the unification magic to
get this right :(  (but if I had some guideline, I might give it a try)

This patch at least makes cgraph consistent about the flags.


Honza

2005-07-27  Jan Hubicka  <jh@suse.cz>

	PR tree-optimization/22574
	* cgraph.c (cgraph_function_body_availability): Unanalyzed bodies are
	not available.
Index: cgraph.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cgraph.c,v
retrieving revision 1.81
diff -c -3 -p -r1.81 cgraph.c
*** cgraph.c	5 Jul 2005 16:19:43 -0000	1.81
--- cgraph.c	27 Jul 2005 06:33:08 -0000
*************** cgraph_function_body_availability (struc
*** 979,985 ****
  {
    enum availability avail;
    gcc_assert (cgraph_function_flags_ready);
!   if (!node->local.finalized)
      avail = AVAIL_NOT_AVAILABLE;
    else if (node->local.local)
      avail = AVAIL_LOCAL;
--- 979,985 ----
  {
    enum availability avail;
    gcc_assert (cgraph_function_flags_ready);
!   if (!node->analyzed)
      avail = AVAIL_NOT_AVAILABLE;
    else if (node->local.local)
      avail = AVAIL_LOCAL;


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