From patchwork Fri Nov 26 20:04:36 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 73242 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 D8440B70D6 for ; Sat, 27 Nov 2010 07:04:55 +1100 (EST) Received: (qmail 17745 invoked by alias); 26 Nov 2010 20:04:52 -0000 Received: (qmail 17734 invoked by uid 22791); 26 Nov 2010 20:04:51 -0000 X-SWARE-Spam-Status: No, hits=-5.2 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 26 Nov 2010 20:04:46 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oAQK4iE8005477 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 26 Nov 2010 15:04:44 -0500 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oAQK4gPe026491 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 26 Nov 2010 15:04:44 -0500 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id oAQK4fTu019052; Fri, 26 Nov 2010 18:04:42 -0200 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oAQK4cmb022165; Fri, 26 Nov 2010 18:04:38 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id oAQK4aUI022163; Fri, 26 Nov 2010 18:04:36 -0200 From: Alexandre Oliva To: Richard Guenther Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] Fix PR46528 References: Date: Fri, 26 Nov 2010 18:04:36 -0200 In-Reply-To: (Richard Guenther's message of "Thu, 25 Nov 2010 16:53:33 +0100 (CET)") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) 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 On Nov 25, 2010, Richard Guenther wrote: > PR tree-optimization/46528 > * profile.c (branch_prob): Do not split blocks based on locations > from debug statements. I see you noticed this is also debug/46338, for which I posted an identical patch, save for whitespace and Zdenek's reduced testcase. Sorry that it took me so long to post the patch in its final form, I'd had it for quite a while, but was having trouble completing testing because of other unrelated problems. Ok to install the testcase? for gcc/testsuite/ChangeLog from Alexandre Oliva PR debug/46338 * g++.dg/debug/pr46338.C: New. Index: gcc/testsuite/g++.dg/debug/pr46338.C =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ gcc/testsuite/g++.dg/debug/pr46338.C 2010-11-26 03:15:26.561728156 -0200 @@ -0,0 +1,24 @@ +// PR debug/46338 +// { dg-do compile } +// { dg-options "-O -fprofile-generate -fcompare-debug" } + +void bar (); + +struct S +{ + int f () + { + } +}; + +S *s; + +void +foo (int x) +{ + if (x) + return; + bar (); + for (int j = 0; j < s->f (); j++) + ; +}