From patchwork Thu Oct 12 18:09:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Law X-Patchwork-Id: 825008 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-464050-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tTtRtiII"; 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 3yCf5j0PSNz9s7c for ; Fri, 13 Oct 2017 05:10:14 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=bYuf3jIzgzzR8d4JqXxm5HBS4djQJtVyeAuBP+umAiDOgdTWj4 L0sFamyF4zPGkQxNKXlPpOxnPTGYPtn6RGgdg8jLOnZybJOgAq4T4ze/QB2ZpOKI mdSBskKXgmMw1s+S6SD/oml3FjOnOwMcaLEdP9dBsd0oHaEySmJBfyXdU= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=0XkkRBcmLM9U5dmtDIFP0Zy3hoQ=; b=tTtRtiIIQGzcgHCGhotv aa9IOs5SoH0LMGxsOGmjyFUacLl/VTAyazkOT1/crlUHoF3daFPKR54UzQp3vKC0 uXQNdoedPfTDw+2rDt6IZ4yX4llscF0cwpqFrwomfisvMt06iYOyo1ovE4+UQu5n Eo/s6cWXcOonFcX/6wuYi6Y= Received: (qmail 108326 invoked by alias); 12 Oct 2017 18:10:07 -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 108268 invoked by uid 89); 12 Oct 2017 18:10:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=ls, thankfully, uncommon, U*law 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; Thu, 12 Oct 2017 18:10:05 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 84691C059B80 for ; Thu, 12 Oct 2017 18:10:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 84691C059B80 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=law@redhat.com Received: from localhost.localdomain (ovpn-112-4.rdu2.redhat.com [10.10.112.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id E497460638 for ; Thu, 12 Oct 2017 18:10:01 +0000 (UTC) To: gcc-patches From: Jeff Law Subject: Minor tree-ssa-dse.c bugfix Message-ID: <9cf3ac7f-6629-a795-7d0e-8ade3c53184b@redhat.com> Date: Thu, 12 Oct 2017 12:09:59 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 X-IsSubscribed: yes While working with Martin L's bugfix/cleanup I came across a minor bug in the DSE code. Specifically it mis-handles references with negative offsets. Example code can be found in gcc.dg/pr48335-4.c. Thankfully these are relatively uncommon and we can just prune them from consideration without having major missed-optimization concerns. Bootstrapped & regression tested with and without Martin L's bugfixes. Installing on the trunk. JEff commit 261fc575195492afbedce5ebd872a2a25fe6efb1 Author: law Date: Thu Oct 12 18:09:11 2017 +0000 * tree-ssa-dse.c (valid_ao_ref_for_dse): Reject ao_refs with negative offsets. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@253691 138bc75d-0d04-0410-961f-82ee72b054a4 diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc17b705025..d5ee088e77f 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2017-10-12 Jeff Law + + * tree-ssa-dse.c (valid_ao_ref_for_dse): Reject ao_refs with + negative offsets. + 2017-10-12 Martin Sebor PR other/82301 diff --git a/gcc/tree-ssa-dse.c b/gcc/tree-ssa-dse.c index 6f58fffc693..87e2fce9ac5 100644 --- a/gcc/tree-ssa-dse.c +++ b/gcc/tree-ssa-dse.c @@ -131,6 +131,7 @@ valid_ao_ref_for_dse (ao_ref *ref) && ref->max_size != -1 && ref->size != 0 && ref->max_size == ref->size + && ref->offset >= 0 && (ref->offset % BITS_PER_UNIT) == 0 && (ref->size % BITS_PER_UNIT) == 0 && (ref->size != -1));