From patchwork Fri Jul 16 20:23:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 59124 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id CC5FFB6F35 for ; Sat, 17 Jul 2010 06:23:29 +1000 (EST) Received: (qmail 6696 invoked by alias); 16 Jul 2010 20:23:28 -0000 Received: (qmail 6684 invoked by uid 22791); 16 Jul 2010 20:23:27 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from g6t0186.atlanta.hp.com (HELO g6t0186.atlanta.hp.com) (15.193.32.63) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 16 Jul 2010 20:23:16 +0000 Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g6t0186.atlanta.hp.com (Postfix) with ESMTP id 990EC2DA98; Fri, 16 Jul 2010 20:23:14 +0000 (UTC) Received: from lucas.cup.hp.com (lucas.cup.hp.com [15.244.97.116]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 0E2122025C; Fri, 16 Jul 2010 20:23:13 +0000 (UTC) Received: (from sje@localhost) by lucas.cup.hp.com (8.11.1 (PHNE_35485)/8.11.1) id o6GKNDN19230; Fri, 16 Jul 2010 13:23:13 -0700 (PDT) Date: Fri, 16 Jul 2010 13:23:13 -0700 (PDT) From: Steve Ellcey Message-Id: <201007162023.o6GKNDN19230@lucas.cup.hp.com> To: gcc-patches@gcc.gnu.org Subject: [Patch, middle-end] Fix PR 44878, IA64 build failure, partial inlining Cc: hubicka@gcc.gnu.org Reply-to: sje@cup.hp.com Mime-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@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))); }