From patchwork Tue Nov 29 06:36:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Pinski X-Patchwork-Id: 700336 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 3tSYjD4vQ6z9vDl for ; Tue, 29 Nov 2016 17:36:15 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="f+JdM5mS"; 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 :mime-version:from:date:message-id:subject:to:content-type; q= dns; s=default; b=j+U01FJbrqW9vnNxdOQ/vPq4ypREpaTvY1u/uCQTCL1F/H vfYm/OrKFkxUhTKFfXvWzUqL36FAylqHrGZTMAxX0kNhUlDmS8sjbaL2ldM8k34D WolBsMDDmwsWMArFu6CDtaH8/dcMVLIkjIl+Vli0/SdkscgrKMa8mCo1rdprg= 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 :mime-version:from:date:message-id:subject:to:content-type; s= default; bh=GEoGpV8RBa9nYDM6h0Pa67q5LPE=; b=f+JdM5mSLFFgkliq9Poo NviiKUajRGcpq/ooHHYykhrzh8VAG124hrnbWs3bM+VR/VZgnUCe0349PNPUAhbz ossnjkn+61DIR/YBIgIjvOGSuMjHrqU1TGdfPtHbEE0tUhFoANobJrESzn9bMRwE XZSWrjby1BBdrHKdGERDbEc= Received: (qmail 67353 invoked by alias); 29 Nov 2016 06:36:06 -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 67339 invoked by uid 89); 29 Nov 2016 06:36:05 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1044 X-HELO: mail-yw0-f170.google.com Received: from mail-yw0-f170.google.com (HELO mail-yw0-f170.google.com) (209.85.161.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 29 Nov 2016 06:36:03 +0000 Received: by mail-yw0-f170.google.com with SMTP id a10so131901536ywa.3 for ; Mon, 28 Nov 2016 22:36:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=tS4l7DfjIUUWXVGCiLB4e8xe4IVWYbnHK/0Rwu2RkpI=; b=QgcgVAMX+vIGBxV6ammLUKYZZohNx/KeoaC8XsrrWdHOcuSL2vsLZOHn+i/Y4eoKUB XIrtrAS5nZx76UJBYih6//EFxF9TbP/w0Mj+UUyerdrbOd2J/MrGwiZD62ys0+q/Nojd D1ZEp/9Lr3bo3gKGI9M0X7t/65xh/I23YMtx1cB7Vnym0Iq25HwGf6MBI/SZ6guXFOAj ifNWZY7cHlg6AUPeP2h14fZzunhcKD10w7MN4I3XKwt6g7+y5NRzHFNJsZ/evNzChGuG 8VLA5/4B58DLT9FtMejrmGdtSbHCAJsEpC5yHDfiIlMuAqnJKi2W/a6Z2zxg+D9HSwU9 7bSA== X-Gm-Message-State: AKaTC03Hy5vzXSuImtuzx3DGR3Mr+0D7Y6hzyK4QbE0mPA60koGVuYpwwMuhhQ8tpXuVyjKvNcTc3qRh1QQKzw== X-Received: by 10.129.169.132 with SMTP id g126mr29584198ywh.92.1480401362177; Mon, 28 Nov 2016 22:36:02 -0800 (PST) MIME-Version: 1.0 Received: by 10.129.42.65 with HTTP; Mon, 28 Nov 2016 22:36:01 -0800 (PST) From: Andrew Pinski Date: Mon, 28 Nov 2016 22:36:01 -0800 Message-ID: Subject: [PATCH/VRP] Fix type of EQ_EXPR To: GCC Patches X-IsSubscribed: yes While rewriting PHI-OPT to use match and simplify infrastructure, I ran into a problem where VRP pass would create a EQ_EXPR which has a non boolean type inside the VRP pass. This currently works on accident as it seems we don't check the type of the argument of COND_EXPR gimple to be boolean type if it is a comparison. OK? Bootstrapped and tested on aarch64-linux-gnu with no regressions. Thanks, Andrew Pinski ChangeLog: * tree-vrp.c (simplify_stmt_using_ranges): Use boolean_type_node for the EQ_EXPR. Index: tree-vrp.c =================================================================== --- tree-vrp.c (revision 242933) +++ tree-vrp.c (working copy) @@ -10225,7 +10225,7 @@ simplify_stmt_using_ranges (gimple_stmt_ in divide by zero, new_rhs1 / new_rhs will be NULL_TREE. */ if (new_rhs1 && new_rhs2) { - tree cond = build2 (EQ_EXPR, TREE_TYPE (cmp_var), cmp_var, val1); + tree cond = build2 (EQ_EXPR, boolean_type_node, cmp_var, val1); gimple_assign_set_rhs_with_ops (gsi, COND_EXPR, cond, new_rhs1,