From patchwork Wed Dec 22 12:18:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 76396 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 EE64BB7088 for ; Wed, 22 Dec 2010 23:18:13 +1100 (EST) Received: (qmail 22335 invoked by alias); 22 Dec 2010 12:18:11 -0000 Received: (qmail 22325 invoked by uid 22791); 22 Dec 2010 12:18:10 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, TW_TM X-Spam-Check-By: sourceware.org Received: from mail-iw0-f175.google.com (HELO mail-iw0-f175.google.com) (209.85.214.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 22 Dec 2010 12:18:03 +0000 Received: by iwn8 with SMTP id 8so5329019iwn.20 for ; Wed, 22 Dec 2010 04:18:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.231.191.4 with SMTP id dk4mr6720898ibb.31.1293020282222; Wed, 22 Dec 2010 04:18:02 -0800 (PST) Received: by 10.231.15.2 with HTTP; Wed, 22 Dec 2010 04:18:02 -0800 (PST) In-Reply-To: References: Date: Wed, 22 Dec 2010 13:18:02 +0100 Message-ID: Subject: Re: [PR debug/46931] don't crash propagating removed DEFs into debug stmts From: Richard Guenther To: Alexandre Oliva Cc: gcc-patches@gcc.gnu.org X-IsSubscribed: yes 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 On Wed, Dec 22, 2010 at 4:54 AM, Alexandre Oliva wrote: > On Dec 21, 2010, Alexandre Oliva wrote: > >> The is_gimple_min_invariant() test was a last-minute thought that was >> supposed to be extended so as to handle the case at hand but not other >> expressions that can't be moved about, but that I forgot about before >> testing and posting the patch.  Oops ;-) > > Here's a revised version.  Regression-tested on x86_64-linux-gnu after > bootstrap with BOOT_CFLAGS='-O2 -g -ftree-vectorize'. Hm. I don't like the awkward flow of operation in your change. We on purpose created debug temps for multiple uses to avoid memory growth. So, the if (value_unshare) code in the loop adjusting the uses should go before that loop and unconditionally create a debug temporary (and thus doesn't need unsharing either). In fact - for the case of removed statements we simply should insert the debug temp at the immediate common dominator of all uses. Or without implementing this, can't we avoid this in the simple-DCE code instead? Like with That completely should avoid the names-to-rename issue and I'd be much more happy with the above for 4.6. Richard. > > > -- > Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/   FSF Latin America board member > Free Software Evangelist      Red Hat Brazil Compiler Engineer > > Index: tree-vect-loop-manip.c =================================================================== --- tree-vect-loop-manip.c (revision 167471) +++ tree-vect-loop-manip.c (working copy) @@ -1442,6 +1442,9 @@ if (update_first_loop_count) slpeel_make_loop_iterate_ntimes (first_loop, first_niters); + BITMAP_FREE (definitions); + delete_update_ssa (); + /* Remove all pattern statements from the loop copy. They will confuse the expander if DCE is disabled. ??? The pattern recognizer should be split into an analysis and @@ -1451,9 +1454,6 @@ adjust_vec_debug_stmts (); - BITMAP_FREE (definitions); - delete_update_ssa (); - return new_loop; }