From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9932 invoked by alias); 4 May 2015 21:40:00 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 9921 invoked by uid 89); 4 May 2015 21:40:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_LOW autolearn=no version=3.3.2 X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 04 May 2015 21:39:58 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 629AF2831414; Mon, 4 May 2015 23:39:55 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NyvPNfILw1KF; Mon, 4 May 2015 23:39:55 +0200 (CEST) Received: from polaris.localnet (bon31-6-88-161-99-133.fbx.proxad.net [88.161.99.133]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 1FFF22831410; Mon, 4 May 2015 23:39:55 +0200 (CEST) From: Eric Botcazou To: Richard Biener Cc: gcc-patches@gcc.gnu.org Subject: Re: [patch] Perform anonymous constant propagation during inlining Date: Mon, 04 May 2015 21:40:00 -0000 Message-ID: <6508064.T36Z3tQFqI@polaris> User-Agent: KMail/4.7.2 (Linux/3.1.10-1.29-desktop; KDE/4.7.2; x86_64; ; ) In-Reply-To: <1538996.TcTA0zy8bB@polaris> References: <6476732.lMFodJZTVz@polaris> <3882455.jixBbSixVe@polaris> <1538996.TcTA0zy8bB@polaris> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-SW-Source: 2015-05/txt/msg00260.txt.bz2 > 2015-05-01 Eric Botcazou > > * expr.c (expand_expr_real_1) : Try to substitute constants > on the RHS of expressions. > * gimple-expr.h (is_gimple_constant): Reorder. Bummer. This breaks C++ debugging: +FAIL: gdb.cp/class2.exp: print alpha at marker return 0 +FAIL: gdb.cp/class2.exp: print beta at marker return 0 +FAIL: gdb.cp/class2.exp: print * aap at marker return 0 +FAIL: gdb.cp/class2.exp: print * bbp at marker return 0 +FAIL: gdb.cp/class2.exp: print * abp at marker return 0, s-p-o off +FAIL: gdb.cp/class2.exp: print * (B *) abp at marker return 0 +FAIL: gdb.cp/class2.exp: p acp +FAIL: gdb.cp/class2.exp: p acp->c1 +FAIL: gdb.cp/class2.exp: p acp->c2 because C++ is apparently relying on the assignment to the anonymous return object to preserve the debug info attached to a return statement. Would you be OK with a slight variation of your earlier idea, i.e. calling fold_stmt with a specific valueizer from fold_marked_statements instead of the implicit no_follow_ssa_edges in the inliner? Something like: tree follow_anonymous_single_use_edges (tree val) { if (TREE_CODE (val) == SSA_NAME && (!SSA_NAME_VAR (val) || DECL_IGNORED_P (SSA_NAME_VAR (var))) && has_single_use (val)) return val return NULL_TREE; } -- Eric Botcazou