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]

[Patch, middle-end] Fix PR 44878, IA64 build failure, partial inlining


I have not been able to bootstrap GCC on ia64-hp-hpux11.23 since the
partial inlining change went in.  Even if I set flag_partial_inlining
to zero I cannot build.  This patch fixes the build enough so that I
can bootstrap with flag_partial_inlining set to zero but it still does
not allow me to build with partial inlining turned on (PR 44716).

The problem I am running into when flag_partial_inlining is zero  is the
'!DECL_BY_REFERENCE (t)' check that was added to
"needs_to_live_in_memory()" during the partial inlining checking
(r161898).  With this check in place I  get an ICE and without it things
work fine so I would like to remove it.  It doesn't seem to affect any
of my other builds (including x86) but it does break the IA64 build.

Looking at the code it seems odd in that we now have (in
needs_to_live_in_memory):

   return (TREE_ADDRESSABLE (t)
          || is_global_var (t)
          || (TREE_CODE (t) == RESULT_DECL
              && !DECL_BY_REFERENCE (t)
              && aggregate_value_p (t, current_function_decl)));

And inside 'aggregate_value_p' we have:

	  /* If the front end has decided that this needs to be passed by
             reference, do so.  */
          if ((TREE_CODE (exp) == PARM_DECL || TREE_CODE (exp) == RESULT_DECL)
              && DECL_BY_REFERENCE (exp))
            return 1;

So if aggregate_value_p is going out of its way to return TRUE for 
DECL_BY_REFERENCE why is needs_to_live_in_memory going out of its way to
return FALSE?  I think if something is being returned by reference it
does need to live in memory.  The reference itself does not need to live
in memory but the thing it is referencing does and I think we are talking
here about the thing being referenced, not the reference itself.

Tested on IA64 HP-UX and Linux and on x86 Linux.  OK for checkin?

Steve Ellcey
sje@cup.hp.com



2010-07-16  Steve Ellcey  <sje@cup.hp.com>

	PR middle-end/44878
	* tree.c (needs_to_live_in_memory):  Remove DECL_BY_REFERENCE check.


Index: tree.c
===================================================================
--- tree.c	(revision 162239)
+++ tree.c	(working copy)
@@ -9741,7 +9741,6 @@ needs_to_live_in_memory (const_tree t)
   return (TREE_ADDRESSABLE (t)
 	  || is_global_var (t)
 	  || (TREE_CODE (t) == RESULT_DECL
-	      && !DECL_BY_REFERENCE (t)
 	      && aggregate_value_p (t, current_function_decl)));
 }
 


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