From patchwork Sat Oct 8 19:34:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 77403 Delivered-To: patch@linaro.org Received: by 10.140.97.247 with SMTP id m110csp679834qge; Sat, 8 Oct 2016 12:34:36 -0700 (PDT) X-Received: by 10.98.33.214 with SMTP id o83mr30666275pfj.149.1475955276451; Sat, 08 Oct 2016 12:34:36 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id 24si15620413pfo.166.2016.10.08.12.34.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Oct 2016 12:34:36 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-438025-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org; spf=pass (google.com: domain of gcc-patches-return-438025-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-438025-patch=linaro.org@gcc.gnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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=Yp5sEw572dwTkPc6JRYUTPDc06RzzvQZ68b1rJQkSH7By7FQ2w YenMCzNxS7Eno0b1PTDF9Tk/PUUJoCENPF+V21N/8m0+CASWXudm6YfIsLnmPwkb J/HuqSMaI2qr4rq8XNn2gajGHYlKH+RUgkK3gkbwDcRnud6Ur6UBScGik= 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=e04po4Xh5Em+gVMKrYFoqr8VyLo=; b=T5R4XMVhG1OszAawJf89 OQSeHPWsbdmFiGm9BkcUfltj/LZzZL/EjG3yfzI9D6zeE5xrqW9f7qRtiUXIIrvV y36E52MdJFrRo6BFiTPgOlzV4rPnEyqL9M9rxlirqSVQ0C89o/MA28C9DjOOSsUO JGMItQMYa/S1DNG05BRAGYo= Received: (qmail 65605 invoked by alias); 8 Oct 2016 19:34:23 -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 65593 invoked by uid 89); 8 Oct 2016 19:34:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=2016-10-09, 20161009, ongoing, vr0 X-HELO: mail-pa0-f48.google.com Received: from mail-pa0-f48.google.com (HELO mail-pa0-f48.google.com) (209.85.220.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 08 Oct 2016 19:34:12 +0000 Received: by mail-pa0-f48.google.com with SMTP id ry6so35278290pac.3 for ; Sat, 08 Oct 2016 12:34:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version; bh=tMs3WBpBFwcvhTWU5BpfAH/dfBNpbEKwlTt7dudjaiY=; b=Hw9JYZCm8lIyUbRBPzJ96sa3IM/wqtyrcvmD/2Uh1N47b1rv4FYkY7OvvFY2j8YB6X 9XcJYdeBGdqupdNzlMu9kyprKL4zGv+pqyYLH2D/UoKCPl5Y/zMC3ZZpM9Cey+VrED47 zEfzdQm6OeMedTcIMmYvuIimLexbUm/FrXMeRsx58+nKfSUrgzhiz/DQhoGrS/j4Z98T KUSncLOFFLRPKnQrVfxfQSgW51RlvaLlJqu3UrCFA/fITKl6q8cgl4gqhTdkXJH4Uie3 lPZdjuw77gUZ/mW96kpIRcO4wYK9KkwCEFL8Zo0XouLn4/5+jKzkTBI1fkZsIhCyssgj Ttdw== X-Gm-Message-State: AA6/9RmRokXbPMRuy2Bt/TAhxUvdByJw8giWEGP0Gu003QEV1skrapic4SnuM25XkrWfrIw4 X-Received: by 10.66.26.49 with SMTP id i17mr40552246pag.145.1475955250535; Sat, 08 Oct 2016 12:34:10 -0700 (PDT) Received: from [10.1.1.7] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by smtp.gmail.com with ESMTPSA id b129sm23096560pfg.36.2016.10.08.12.34.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 08 Oct 2016 12:34:09 -0700 (PDT) To: "gcc-patches@gcc.gnu.org" From: kugan Subject: [VRP] Allocate bitmap before copying Message-ID: <788a88b5-4e57-d910-3824-f89f6883f929@linaro.org> Date: Sun, 9 Oct 2016 06:34:05 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, In vrp_intersect_ranges_1, when !vr0->equiv, we are copying vr1->equiv without allocating bitmap. This patch fixes this. Bootstrap and regression testing are ongoing. Is this OK if no new regressions? Thanks, Kugan gcc/ChangeLog: 2016-10-09 Kugan Vivekanandarajah * tree-vrp.c (vrp_intersect_ranges_1): Allocate bitmap before copying. >From ccd2fcb909f54f85858f18652abc3a387321f9a1 Mon Sep 17 00:00:00 2001 From: Kugan Vivekanandarajah Date: Sat, 8 Oct 2016 20:23:28 +1100 Subject: [PATCH 2/7] Alloc bitmap --- gcc/tree-vrp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gcc/tree-vrp.c b/gcc/tree-vrp.c index 46bbd82..e758ae4 100644 --- a/gcc/tree-vrp.c +++ b/gcc/tree-vrp.c @@ -8622,7 +8622,10 @@ vrp_intersect_ranges_1 (value_range *vr0, value_range *vr1) if (vr0->equiv && vr1->equiv && vr0->equiv != vr1->equiv) bitmap_ior_into (vr0->equiv, vr1->equiv); else if (vr1->equiv && !vr0->equiv) - bitmap_copy (vr0->equiv, vr1->equiv); + { + vr0->equiv = BITMAP_ALLOC (&vrp_equiv_obstack); + bitmap_copy (vr0->equiv, vr1->equiv); + } } void -- 2.7.4