From patchwork Wed May 16 10:21:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 914519 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-477751-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="ZX36v72q"; 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 40m9TR0v8Dz9s0y for ; Wed, 16 May 2018 20:21:46 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=ILCRasCZgQ9tijP2GXXECIsbmBsWxzIuN/XP7FXICCGYq1mP5MkUp MzhHjm2Yu6Txg1J1Fb93eqXzkPxLBVASvbKEI8Df9emZutW3KDFhHjTiSqn3hs87 ACBepD48xiu6o00Xv9RfXy4Q5GEmzbTH5IusWxWbxhA5OhVWwuAovk= 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:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=onQ9455Y22yXU85ReKxaH2ZT0Ak=; b=ZX36v72qMahINqV1ZyKa o7D7emtphupXqBnOSexPx1a2xjL37VdONJcbHVc0mlRc1yl7YyGAz+ASYKpV1+DM zzHx8otaS6hbN8dT6uxiSR5TGrwBkh19V+oENcmJY52tn8PUdF2iOfPzzpX1h9V1 xXmN/YK+O2o8qQEklnNW+6M= Received: (qmail 118504 invoked by alias); 16 May 2018 10:21:39 -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 118491 invoked by uid 89); 16 May 2018 10:21:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 16 May 2018 10:21:37 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id BAA0BAC46 for ; Wed, 16 May 2018 10:21:35 +0000 (UTC) Date: Wed, 16 May 2018 12:21:35 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] Enhance [VEC_]COND_EXPR verification Message-ID: User-Agent: Alpine 2.20 (LSU 67 2015-01-07) MIME-Version: 1.0 PR85794 shows we do not verify those. Bootstrapped and tested on x86_64-unknown-linux-gnu, applied to trunk. Richard. 2018-05-16 Richard Biener * tree-cfg.c (verify_gimple_assign_ternary): Properly verify the [VEC_]COND_EXPR embedded comparison. Index: gcc/tree-cfg.c =================================================================== --- gcc/tree-cfg.c (revision 260280) +++ gcc/tree-cfg.c (working copy) @@ -4137,6 +4137,12 @@ verify_gimple_assign_ternary (gassign *s } /* Fallthrough. */ case COND_EXPR: + if (!is_gimple_val (rhs1) + && verify_gimple_comparison (TREE_TYPE (rhs1), + TREE_OPERAND (rhs1, 0), + TREE_OPERAND (rhs1, 1), + TREE_CODE (rhs1))) + return true; if (!useless_type_conversion_p (lhs_type, rhs2_type) || !useless_type_conversion_p (lhs_type, rhs3_type)) {