From patchwork Fri Jul 16 20:23:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [middle-end] Fix PR 44878, IA64 build failure, partial inlining Date: Fri, 16 Jul 2010 10:23:13 -0000 From: Steve Ellcey X-Patchwork-Id: 59124 Message-Id: <201007162023.o6GKNDN19230@lucas.cup.hp.com> To: gcc-patches@gcc.gnu.org Cc: hubicka@gcc.gnu.org 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 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))); }