From patchwork Thu Jul 4 16:33:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1127637 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-504422-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="PWfSZ5IF"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 45fk7v6vm3z9sNw for ; Fri, 5 Jul 2019 02:34:02 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=YD2AG4M+l2JueDXZ0QkKHPbgbghBX5Q017B9SYvR+Dao0HajFhPrL 2uEjMyo8R/7PJ7PdpYt6oDD+Hqj8DX5D3ahTDPgNgYISygYgR9ozvcbXrsBap9X7 kBXZvAsSbz2r2mb6niCjhMEjBBkx5AbRKOC8zfXC+96WNjJ+4Dgi2Y= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=VQc5RzdNttWtifk+0uGkt6tt8QA=; b=PWfSZ5IFPpYdbaUU+s0d 0Wd/6dBhmFmAAkTXep9H8DWYRRo5WWqwTIfYQ5mCzagT9gdiRbQtXmKre5FhFqU2 g5tRx133gWiPX7G8qvtsA2s9oA+iXH1SEeJMFPWVrpuKAIQa2ejjS7jTy04mQsr1 MIexGGQdREUEmrUQyZ8IZpE= Received: (qmail 105531 invoked by alias); 4 Jul 2019 16:33:55 -0000 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 Received: (qmail 105523 invoked by uid 89); 4 Jul 2019 16:33:55 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3 autolearn=ham version=3.3.1 spammy=BIT_FIELD_REF, bit_field_ref X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 04 Jul 2019 16:33:54 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 36342281EC5; Thu, 4 Jul 2019 18:33:46 +0200 (CEST) Date: Thu, 4 Jul 2019 18:33:46 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org, d@dcepelik.cz Subject: Fix my previous change in nonoverlapping_component_refs_since_match_p Message-ID: <20190704163346.vpt2ulljetgacziy@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, while working on subsetquent changes I noticed that I got worng the boundary condition while we collect refs. We know that match1 and match2 are the same which means that we want to start disambiguating until the last ref that reach the match. For example when one is MEM_REF and other COMPONENT_REF the ref stacks can get out of sync this way. This makes the function to give up in its current form byt with followup change we get wrong code. Bootstrapped/regtested x86_64-linux, comitted. Honza * tree-ssa-alias.c (nonoverlapping_component_refs_since_match_p): Fix check for match in the ref walk. Index: tree-ssa-alias.c =================================================================== --- tree-ssa-alias.c (revision 273084) +++ tree-ssa-alias.c (working copy) @@ -1153,15 +1153,13 @@ nonoverlapping_component_refs_since_matc auto_vec component_refs2; /* Create the stack of handled components for REF1. */ - while (handled_component_p (ref1)) + while (handled_component_p (ref1) && ref1 != match1) { if (TREE_CODE (ref1) == VIEW_CONVERT_EXPR || TREE_CODE (ref1) == BIT_FIELD_REF) component_refs1.truncate (0); else component_refs1.safe_push (ref1); - if (ref1 == match1) - break; ref1 = TREE_OPERAND (ref1, 0); } if (TREE_CODE (ref1) == MEM_REF && ref1 != match1) @@ -1180,15 +1178,13 @@ nonoverlapping_component_refs_since_matc } /* Create the stack of handled components for REF2. */ - while (handled_component_p (ref2)) + while (handled_component_p (ref2) && ref2 != match2) { if (TREE_CODE (ref2) == VIEW_CONVERT_EXPR || TREE_CODE (ref2) == BIT_FIELD_REF) component_refs2.truncate (0); else component_refs2.safe_push (ref2); - if (ref2 == match2) - break; ref2 = TREE_OPERAND (ref2, 0); } if (TREE_CODE (ref2) == MEM_REF && ref2 != match2)