From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12467 invoked by alias); 17 Nov 2009 15:40:25 -0000 Received: (qmail 12458 invoked by uid 22791); 17 Nov 2009 15:40:24 -0000 X-SWARE-Spam-Status: No, hits=1.1 required=5.0 tests=AWL,BAYES_50,SARE_MSGID_LONG40,SPF_PASS,SUBJECT_FUZZY_VPILL X-Spam-Check-By: sourceware.org Received: from mail-pz0-f203.google.com (HELO mail-pz0-f203.google.com) (209.85.222.203) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 17 Nov 2009 15:39:28 +0000 Received: by pzk41 with SMTP id 41so62150pzk.0 for ; Tue, 17 Nov 2009 07:39:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.193.9 with SMTP id q9mr526657rvf.178.1258472367193; Tue, 17 Nov 2009 07:39:27 -0800 (PST) In-Reply-To: References: <84fc9c000911080156iff6d687o26db10af3e9fba5d@mail.gmail.com> Date: Tue, 17 Nov 2009 15:47:00 -0000 Message-ID: <84fc9c000911170739v76a2e911vc6794e597c8d134e@mail.gmail.com> Subject: Re: [vta, graphite?] propagate degenerate phi nodes into debug stmts From: Richard Guenther To: Alexandre Oliva 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: 2009-11/txt/msg00865.txt.bz2 On Mon, Nov 16, 2009 at 9:41 PM, Alexandre Oliva wrote: > On Nov =A08, 2009, Richard Guenther wrote: > >> For the rest it would be better to re-organize the code as > >> =A0 =A0else if (gimple_code (def_stmt) =3D=3D PHI_NODE) >> =A0 =A0 =A0{ >> =A0 =A0 =A0 =A0 value =3D degenerate_phi_result (def_stmt); >> =A0 =A0 =A0 =A0 if (value >> =A0 =A0 =A0 =A0 =A0 =A0 && walk_tree (&value, find_released_ssa_name, NU= LL, NULL)) >> =A0 =A0 =A0 =A0 =A0 value =3D NULL_TREE; >> =A0 =A0 =A0} > >> that looks simpler and it avoids walking PHI args uselessly. > > That doesn't work. =A0We crash deep within degenerate_phi_result given > expressions containing released SSA names. =A0It's the same reason why we > have to test for released SSA names before calling > gimple_assign_rhs_to_tree: IIRC it has to do with testing whether the > already-NULL type of the SSA name is a pointer type. Well, just adjust degenerate_phi_result to do instead of calling operand_equal_p else if (TREE_CODE (arg) !=3D TREE_CODE (val) || (TREE_CODE (arg) =3D=3D SSA_NAME && arg !=3D val) || !operand_equal_p (arg, val, 0)) break; that should fix it. Alternatively add the SSA_NAME shortcut to operand_equal_p. > Regardless, I reorganized the code so as to not have to test for > PHI_NODEs as often. =A0There were two unrelated code paths intermixed with > tests every now and again. =A0Now they're two separate code flows. > >> @@ -479,6 +508,13 @@ insert_debug_temps_for_defs (gimple_stmt > >> =A0 =A0stmt =3D gsi_stmt (*gsi); > >> + =A0if (gimple_code (stmt) =3D=3D GIMPLE_PHI) >> + =A0 =A0{ >> + =A0 =A0 =A0tree var =3D gimple_phi_result (stmt); >> + =A0 =A0 =A0insert_debug_temp_for_var_def (gsi, var); >> + =A0 =A0 =A0return; >> + =A0 =A0} >> + > >> This looks odd. =A0SSA DEF operand iteration should walk the PHI defs >> as well, so the change should not be necessary. > > I thought so, too, but by the time we get there, the operands of the PHI > stmt have already been disconnected. It shouldn't be. Please try to figure out why instead. Thanks, Richard. > Here's what I'm going to test now. > > > > -- > Alexandre Oliva, freedom fighter =A0 =A0http://FSFLA.org/~lxoliva/ > You must be the change you wish to see in the world. -- Gandhi > Be Free! -- http://FSFLA.org/ =A0 FSF Latin America board member > Free Software Evangelist =A0 =A0 =A0Red Hat Brazil Compiler Engineer > >