From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1791 invoked by alias); 1 Nov 2010 22:30:09 -0000 Received: (qmail 1667 invoked by uid 22791); 1 Nov 2010 22:30:05 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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; Mon, 01 Nov 2010 22:29:59 +0000 Received: by iwn42 with SMTP id 42so6614910iwn.20 for ; Mon, 01 Nov 2010 15:29:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.231.10.134 with SMTP id p6mr10862058ibp.50.1288650597856; Mon, 01 Nov 2010 15:29:57 -0700 (PDT) Received: by 10.231.39.138 with HTTP; Mon, 1 Nov 2010 15:29:57 -0700 (PDT) In-Reply-To: <20101101192153.GA29412@tyan-ft48-01.lab.bos.redhat.com> References: <20101101192153.GA29412@tyan-ft48-01.lab.bos.redhat.com> Date: Mon, 01 Nov 2010 23:07:00 -0000 Message-ID: Subject: Re: [PATCH] Fix -fcompare-debug issue in tree profiler (PR debug/46255) From: Richard Guenther To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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: 2010-11/txt/msg00094.txt.bz2 On Mon, Nov 1, 2010 at 8:21 PM, Jakub Jelinek wrote: > Hi! > > While debug stmts are never considered to need fake edges, it currently > (incorrectly) makes a difference whether a stmt that needs fake edges > was the last one or not. =A0Fixed by disregarding any debug stmts > at the end of bb. > > Bootstrapped/regtested on x86_64-linux and i686-linux. =A0Ok for trunk? Hmm, you mean that the stmt needing fake edges doesn't end the BB? So your patch fixes that by splitting the BB at the appropriate point? If so, it's ok. Thanks, Richard. > 2010-11-01 =A0Jakub Jelinek =A0 > > =A0 =A0 =A0 =A0PR debug/46255 > =A0 =A0 =A0 =A0* tree-cfg.c (gimple_flow_call_edges_add): Use gsi_last_no= ndebug_bb > =A0 =A0 =A0 =A0instead of gsi_last_bb. > > =A0 =A0 =A0 =A0* gcc.dg/pr46255.c: New test. > > --- gcc/tree-cfg.c.jj =A0 2010-11-01 09:07:24.000000000 +0100 > +++ gcc/tree-cfg.c =A0 =A0 =A02010-11-01 14:03:05.000000000 +0100 > @@ -6749,7 +6749,7 @@ gimple_flow_call_edges_add (sbitmap bloc > =A0 if (check_last_block) > =A0 =A0 { > =A0 =A0 =A0 basic_block bb =3D EXIT_BLOCK_PTR->prev_bb; > - =A0 =A0 =A0gimple_stmt_iterator gsi =3D gsi_last_bb (bb); > + =A0 =A0 =A0gimple_stmt_iterator gsi =3D gsi_last_nondebug_bb (bb); > =A0 =A0 =A0 gimple t =3D NULL; > > =A0 =A0 =A0 if (!gsi_end_p (gsi)) > @@ -6783,7 +6783,7 @@ gimple_flow_call_edges_add (sbitmap bloc > =A0 =A0 =A0 if (blocks && !TEST_BIT (blocks, i)) > =A0 =A0 =A0 =A0continue; > > - =A0 =A0 =A0gsi =3D gsi_last_bb (bb); > + =A0 =A0 =A0gsi =3D gsi_last_nondebug_bb (bb); > =A0 =A0 =A0 if (!gsi_end_p (gsi)) > =A0 =A0 =A0 =A0{ > =A0 =A0 =A0 =A0 =A0last_stmt =3D gsi_stmt (gsi); > --- gcc/testsuite/gcc.dg/pr46255.c.jj =A0 2010-11-01 14:04:55.000000000 += 0100 > +++ gcc/testsuite/gcc.dg/pr46255.c =A0 =A0 =A02010-11-01 14:04:34.0000000= 00 +0100 > @@ -0,0 +1,12 @@ > +/* PR debug/46255 */ > +/* { dg-do compile } */ > +/* { dg-options "-fcompare-debug -fprofile-generate -O" } */ > + > +int bar (void); > + > +void > +foo (int i) > +{ > + =A0while (i) > + =A0 =A0i =3D bar (); > +} > > =A0 =A0 =A0 =A0Jakub >