From patchwork Wed Sep 3 10:35:11 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 385483 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 4E09C1401EF for ; Wed, 3 Sep 2014 20:42:57 +1000 (EST) 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=gNocgVOB8OJck2+Xq2Y3BrOBy2aCTDnJpKzJZJx7KC8j7ixjQ77Md dOczGSUdBthqFquf9D+C9x/r8vh7CHNc4p6gbDShJaoHR3ocBCUzl6+V860FtAOq /aiFRkY/jm3Q1JauEmgavOjPuEWXzkKP98maiKhzOwJnAky5cUID5M= 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=JcNiKZ0w09+bHaGfpQRqHCB7lYg=; b=ssrqKVnXXknwx7w0AlSz CEeH7rGQO2IWqEdfM9F01eCAKl6H8qH9C5av6BfntYypQ5ydSepiDXZ9FhfWZFIS BSCcx/JS/0zo0Lsiw3DkgzPpgWzZzc6BJaGA+JvJe+hEfkyfrEpsOmIRD1p1crup 6YVTqkJy7TJPWjUDOWIPYVk= Received: (qmail 22657 invoked by alias); 3 Sep 2014 10:38:41 -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 22632 invoked by uid 89); 3 Sep 2014 10:38:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.1 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx2.suse.de Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 03 Sep 2014 10:38:40 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4C2E5AB08 for ; Wed, 3 Sep 2014 10:38:37 +0000 (UTC) Date: Wed, 3 Sep 2014 12:35:11 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH][match-and-simplify] Fix error in VCE pattern Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 The pattern (and the fold_unary code it was derived from) stripping inner conversions from VIEW_CONVERT_EXPRs is bogus as in that it doesn't make sure the the size of the types match. This triggers a IL verification for gfortran.fortran-torture/compile/forall-1.f90 otherwise. Committed to the branch. Richard. 2014-09-03 Richard Biener * match-conversions.pd ((view_convert (convert @0)) -> (view_convert @0)): Restrict to conversions that do not change size. Index: gcc/match-conversions.pd =================================================================== --- gcc/match-conversions.pd (revision 214864) +++ gcc/match-conversions.pd (working copy) @@ -77,12 +77,13 @@ && TYPE_PRECISION (type) == TYPE_PRECISION (TREE_TYPE (@0))) (convert @0))) -/* Strip inner integral conversions that do not change the precision. */ +/* Strip inner integral conversions that do not change precision or size. */ (simplify (view_convert (convert@0 @1)) (if ((INTEGRAL_TYPE_P (TREE_TYPE (@0)) || POINTER_TYPE_P (TREE_TYPE (@0))) && (INTEGRAL_TYPE_P (TREE_TYPE (@1)) || POINTER_TYPE_P (TREE_TYPE (@1))) - && (TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (TREE_TYPE (@1)))) + && (TYPE_PRECISION (TREE_TYPE (@0)) == TYPE_PRECISION (TREE_TYPE (@1))) + && (TYPE_SIZE (TREE_TYPE (@0)) == TYPE_SIZE (TREE_TYPE (@1)))) (view_convert @1)))