From patchwork Sat Sep 24 18:50:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kugan Vivekanandarajah X-Patchwork-Id: 76935 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp445046qgf; Sat, 24 Sep 2016 11:51:00 -0700 (PDT) X-Received: by 10.67.5.33 with SMTP id cj1mr23590502pad.120.1474743060215; Sat, 24 Sep 2016 11:51:00 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id c6si14763191pfj.136.2016.09.24.11.50.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2016 11:51:00 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-436799-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-436799-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gcc-patches-return-436799-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:from :subject:to:message-id:date:mime-version:content-type; q=dns; s= default; b=GP2n4NkCraAvynA3iTI7aNBJO/EHx1Y0NAGpDsHPZnzQPMFcG6VK2 6b9ikbtCi2l3MGIksMblIQYz2ZX2fFOSDiTSw182h14Vym92UZTjAjBEVJ1H3H4d gqpVKq6baojXUKjCyoZwesq66HqX/Ay1WW1+faRUNFBQBrQTDMVXek= 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:from :subject:to:message-id:date:mime-version:content-type; s= default; bh=JmIDhO19V7RfXngBTZ3gpzErRAQ=; b=C47GInXofRz/jNyH9Q2F hvBUm7njHKtpxWyfBkYjOx+DM9Yt/S/PiBxXSIyjkUdnLWGrlW4Up9tKgLJw3p+i 8loX97ffwRWE8EtatavJfY/xDy6XL7lUe0fZzgIsY2dc2fsSAzTYUUuACPacWFxu 50Je7ZuI4WEA4FwbsflYxCM= Received: (qmail 109301 invoked by alias); 24 Sep 2016 18:50:45 -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 109288 invoked by uid 89); 24 Sep 2016 18:50:44 -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=make_ssa_name, HX-Received:10.66.72.40, isp X-HELO: mail-pa0-f43.google.com Received: from mail-pa0-f43.google.com (HELO mail-pa0-f43.google.com) (209.85.220.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 24 Sep 2016 18:50:34 +0000 Received: by mail-pa0-f43.google.com with SMTP id oz2so49896349pac.2 for ; Sat, 24 Sep 2016 11:50:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:message-id:date:user-agent :mime-version; bh=XgCZMh95kuL+sKLNcWE68hFQYYJXkJsw8wdyOJ4LSRU=; b=XEs2bUD6C2bq2vq0aZQtGo98qEk/cIns1xxZGstUc4+c9ccXAXeKiEdRLcRICaDVzr SQCGwFsBKDLMiCONWSVGyeIcEwjy4hH9nwUdDX/Re7/w7pJ9AJdKxbccGutl623QlqVv KWVIJ+Z0ZQNxJpmptV9DEsa0TYmGQoxUISajHF4HM2fpPG0NCNcnQ985OjjMm0j6pI5x 8GYgRsQx2doBvisWNwdY54pj9W5NxOmesAUADdmRn5C22Agssa0jfchNSaylhAmKHFCI cPF9hHZUMdGbTCAtGiGw5YiSm2Ht09yn0h0FysfOGyPSmZULliA2xn0g4cFKXYDF6Xb1 95bg== X-Gm-Message-State: AE9vXwPk51tquDRe2AGlqbWPS6q01/jxz3rLi2W9WWKqMR7i9+2aL8i85NU0isSwlcdRUoKj X-Received: by 10.66.72.40 with SMTP id a8mr23929298pav.15.1474743032931; Sat, 24 Sep 2016 11:50:32 -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 b88sm20091397pfe.66.2016.09.24.11.50.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 24 Sep 2016 11:50:32 -0700 (PDT) From: kugan Subject: [PR77719] Fix ICE in pp_string, at pretty-print.c:955 To: "gcc-patches@gcc.gnu.org" Message-ID: Date: Sun, 25 Sep 2016 04:50:29 +1000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi, In make_new_ssa_for_def (tree-reassoc.c) we should use gimple_get_lhs to get lhs instead of gimple_assign_lhs as stmt can be builtins too. Attached patch fixes this. Testcase from PR (attached) seems to fail. I dont any fortran so I didnt try fixing it. Any help here is appreciate. The log is: Executing on host: /home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../gfortran -B/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../ -B/home/kugan.vivekanandarajah/build/x86_64-pc-linux-gnu/./libgfortran/ /home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90 -fno-diagnostics-show-caret -fdiagnostics-color=never -O -O3 -ffast-math -S -o pr77719.s (timeout = 300) spawn /home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../gfortran -B/home/kugan.vivekanandarajah/build/gcc/testsuite/gfortran/../../ -B/home/kugan.vivekanandarajah/build/x86_64-pc-linux-gnu/./libgfortran/ /home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90 -fno-diagnostics-show-caret -fdiagnostics-color=never -O -O3 -ffast-math -S -o pr77719.s^M /home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90:11:23: Warning: Deleted feature: End expression in DO loop at (1) must be integer^M output is: /home/kugan.vivekanandarajah/gcc/gcc/testsuite/gfortran.dg/pr77719.f90:11:23: Warning: Deleted feature: End expression in DO loop at (1) must be integer^M FAIL: gfortran.dg/pr77719.f90 -O (test for excess errors) Excess errors: I didn't add it due to this. I will leave it to someone else. Bootstrapped and regression tested the attached patch on x86_64-linux-gnu with no new regressions. Is this OK for trunk? Thanks, Kugan gcc/ChangeLog: 2016-09-24 Kugan Vivekanandarajah * tree-ssa-reassoc.c (make_new_ssa_for_def): Use gimple_get_lhs to get lhs instead of gimple_assign_lhs as stmt can be builtins too. diff --git a/gcc/tree-ssa-reassoc.c b/gcc/tree-ssa-reassoc.c index 8fc76e4..d94ff70 100644 --- a/gcc/tree-ssa-reassoc.c +++ b/gcc/tree-ssa-reassoc.c @@ -1158,7 +1158,7 @@ make_new_ssa_for_def (gimple *stmt) use_operand_p use; imm_use_iterator iter; tree new_lhs; - tree lhs = gimple_assign_lhs (stmt); + tree lhs = gimple_get_lhs (stmt); new_lhs = make_ssa_name (TREE_TYPE (lhs)); gimple_set_lhs (stmt, new_lhs);