From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11085 invoked by alias); 5 Mar 2019 21:36:01 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 11063 invoked by uid 89); 5 Mar 2019 21:36:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=no version=3.3.2 spammy=bowels X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 05 Mar 2019 21:36:00 +0000 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5474C3084246; Tue, 5 Mar 2019 21:35:59 +0000 (UTC) Received: from localhost.localdomain (ovpn-112-13.rdu2.redhat.com [10.10.112.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id D89FD5D96F; Tue, 5 Mar 2019 21:35:57 +0000 (UTC) Subject: Re: A bug in vrp_meet? To: Richard Biener , Qing Zhao Cc: GCC Development , gcc Patches References: <933b52ac-d372-f9d9-792e-4166f35b41f5@redhat.com> <327DC916-C1B4-47F9-92AE-468236D32C1F@oracle.com> <81846359-36B4-46F1-9C5C-8E20F927FE9F@oracle.com> From: Jeff Law Openpgp: preference=signencrypt Message-ID: <5d6c4bc0-c000-7b8f-f40e-17b9a104071e@redhat.com> Date: Tue, 05 Mar 2019 21:36:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.3.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2019-03/txt/msg00039.txt.bz2 On 3/5/19 7:44 AM, Richard Biener wrote: > So fixing it properly with also re-optimize_stmt those stmts so we'd CSE > the MAX_EXPR introduced by folding makes it somewhat ugly. > > Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. > > Any ideas how to make it less so? I can split out making optimize_stmt > take a gsi * btw, in case that's a more obvious change and it makes the > patch a little smaller. > > Richard. > > 2019-03-05 Richard Biener > > PR tree-optimization/89595 > * tree-ssa-dom.c (dom_opt_dom_walker::optimize_stmt): Take > stmt iterator as reference, take boolean output parameter to > indicate whether the stmt was removed and thus the iterator > already advanced. > (dom_opt_dom_walker::before_dom_children): Re-iterate over > stmts created by folding. > > * gcc.dg/torture/pr89595.c: New testcase. > Well, all the real logic changs are in the before_dom_children method. The bits in optimize_stmt are trivial enough to effectively ignore. I don't see a better way to discover and process statements that are created in the bowels of fold_stmt. Jeff