From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13090 invoked by alias); 15 Jan 2013 15:52:25 -0000 Received: (qmail 12970 invoked by uid 22791); 15 Jan 2013 15:52:24 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,RCVD_IN_DNSWL_HI X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 15 Jan 2013 15:52:18 +0000 Received: from relay1.suse.de (unknown [195.135.220.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 6C704A3CEE for ; Tue, 15 Jan 2013 16:52:17 +0100 (CET) Date: Tue, 15 Jan 2013 15:52:00 -0000 From: Martin Jambor To: GCC Patches Subject: [PATCH] No SRA debug replacements for variables that cannot be removed Message-ID: <20130115155216.GA22390@virgil.suse> Mail-Followup-To: GCC Patches MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 X-SW-Source: 2013-01/txt/msg00785.txt.bz2 Hi, as discussed in PR 55920, this patch prevents SRA from creating debug replacements and debug statements for aggregate variables which cannot be scalarized away. Jakub bootstrapped and tested the patch and I suppose he is OK with it too so I will commit is shortly. Thanks, Martin 2013-01-11 Martin Jambor PR tree-optimization/55920 * tree-sra.c (analyze_access_subtree): Do not mark non-removable accesses as grp_to_be_debug_replaced. Index: src/gcc/tree-sra.c =================================================================== --- src.orig/gcc/tree-sra.c +++ src/gcc/tree-sra.c @@ -2199,7 +2199,9 @@ analyze_access_subtree (struct access *r { if (allow_replacements && scalar && !root->first_child - && (root->grp_scalar_write || root->grp_assignment_write)) + && (root->grp_scalar_write || root->grp_assignment_write) + && !bitmap_bit_p (cannot_scalarize_away_bitmap, + DECL_UID (root->base))) { gcc_checking_assert (!root->grp_scalar_read && !root->grp_assignment_read);