From patchwork Thu Aug 18 18:25:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Palka X-Patchwork-Id: 660504 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3sFZKP2rd4z9sf9 for ; Fri, 19 Aug 2016 04:25:44 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=iFOvdicz; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=RIZdzwOo28Au aJ/gBBELG2bLwjBA5V+nRcXTfo/Uyt69/t6sYdVKDeR9VIulfky8E/+WhPjSYIts QO77a40H2Yu9CzEM1rlfekt60RsigTYm2hHt0Qmh/vZz2kCyM9VGkxv0jX5WdqiL DS6J2bjiPLo5UQBg1fjBxNAue59sSps= 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 :to:cc:subject:date:message-id; s=default; bh=pj/TfHtBOqJcz5bvXo Zk6cJRrjE=; b=iFOvdiczu2i+/cBcdkwNbZDDkAi2SxHWbdE04Nm6d2Fj4F2PoH T5Ik9h3dyp2wI/k1atoKJODSqccXiOu57KHmE/tH2x3CzMhxOBRnr7x2WDg1eqHn TmyA0tfHW4Rs1GjSEiP07wjxIopJ1+b7N+i4Jwt6o/siSbV5zRM0T8MmQ= Received: (qmail 80138 invoked by alias); 18 Aug 2016 18:25:35 -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 80126 invoked by uid 89); 18 Aug 2016 18:25:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=mishandled, HX-Envelope-From:sk:patrick, H*MI:7397, H*F:D*cx X-HELO: mail-qk0-f193.google.com Received: from mail-qk0-f193.google.com (HELO mail-qk0-f193.google.com) (209.85.220.193) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Aug 2016 18:25:24 +0000 Received: by mail-qk0-f193.google.com with SMTP id v123so2885997qkh.3 for ; Thu, 18 Aug 2016 11:25:24 -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:to:cc:subject:date:message-id; bh=oSRoP/IMNhnIH8lAnU+2JuQpG3IkUEi9YfWHD4AiIh0=; b=lVrbW+kgFKNBHfxAumI7G/A6jUen2YWbWUSD/e+sEJvtLNiZEsN9TcaSj0xxqbLgSV Llq7nwuYVn+eqaL8JYjqm0bcDQlLbBws3GswOJKIlPyeFL42Ris83gPwshXYZmIkilTq o7ynHq0rqGWsedQWVA9QvOmngZBoOnhQGL7x1dd+UF9Ybql/hy9U7aAYhLbQqFSj8f9Z 9MyJxJUMGXb6enkIIiJK6mcv29ut51TtZglmdpt4tNgEKG4v8tvnAmtm3qzzXd0R7GY6 Obatll+qBgxPSPEfELyzns+07wqG+d0sMSHfw2qzCyP068b2mq12o2FRVFgWUSYrf+ml vCvw== X-Gm-Message-State: AEkoousuR8XsdZHA7ue2eBbWdc1MWH8fAuvB8VNhkipe6vYq4pAs4lBVxEKieuz360ntQQ== X-Received: by 10.55.190.68 with SMTP id o65mr2473849qkf.92.1471544723248; Thu, 18 Aug 2016 11:25:23 -0700 (PDT) Received: from localhost.localdomain (ool-4353abbc.dyn.optonline.net. [67.83.171.188]) by smtp.gmail.com with ESMTPSA id m10sm145735qta.31.2016.08.18.11.25.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 11:25:22 -0700 (PDT) From: Patrick Palka To: gcc-patches@gcc.gnu.org Cc: ysrumyan@gmail.com, Patrick Palka Subject: [PATCH] Restrict jump threading statement simplifier to scalar types (PR71077) Date: Thu, 18 Aug 2016 14:25:18 -0400 Message-Id: <20160818182518.7397-1-patrick@parcs.ath.cx> In comment #5 Yuri reports that r235653 introduces a runtime failure for 176.gcc which I guess is caused by the combining step in simplify_control_stmt_condition_1() not behaving properly on operands of type VECTOR_TYPE. I'm a bit stumped as to why it mishandles VECTOR_TYPEs because the logic should be generic enough to support them as well. But it was confirmed that restricting the combining step to operands of scalar type fixes the runtime failure so here is a patch that does this. Does this look OK to commit after bootstrap + regtesting on x86_64-pc-linux-gnu? gcc/ChangeLog: PR tree-optimization/71077 * tree-ssa-threadedge.c (simplify_control_stmt_condition_1): Perform the combining step only if the operands have an integral or a pointer type. --- gcc/tree-ssa-threadedge.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/tree-ssa-threadedge.c b/gcc/tree-ssa-threadedge.c index 170e456..a97c00c 100644 --- a/gcc/tree-ssa-threadedge.c +++ b/gcc/tree-ssa-threadedge.c @@ -577,6 +577,9 @@ simplify_control_stmt_condition_1 (edge e, if (handle_dominating_asserts && (cond_code == EQ_EXPR || cond_code == NE_EXPR) && TREE_CODE (op0) == SSA_NAME + /* ??? Vector types are mishandled here. */ + && (INTEGRAL_TYPE_P (TREE_TYPE (op0)) + || POINTER_TYPE_P (TREE_TYPE (op0))) && integer_zerop (op1)) { gimple *def_stmt = SSA_NAME_DEF_STMT (op0);