From patchwork Sat Apr 7 18:08:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Thomas_K=C3=B6nig?= X-Patchwork-Id: 895950 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-476030-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkoenig.net Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="hC87plB1"; 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 40JPhX14j5z9s0W for ; Sun, 8 Apr 2018 04:08:57 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=cs5xfBo934JGdzDgyYRCBbD3NBP3OWNHY2zNsuTJdTlU+EEkSv IJwsq1z1nm4HqRKCrVpj35t2Jb9mIFXl5FEfDmp1c2k7i6x2suNmZ8EJcFagKubc 8Hrd3BBlpTIoLPdLzajgwkd6zGGKU/weGJb8wxG6jx1lB+4XcqHGaMybo= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=0Fg/nexePy1oDGCyGKUu5U4mhuU=; b=hC87plB1esX31cFQZAqd x1jKjWcjigFZPF1T0CCHWHGopUI16iWiLQ01fVZQvMq+AGT8IaMT9Z8n5jw8s0+t VpUP+JGGgG3n+Bq/U2pdD5uNXqb9kpqgJm1dsMWOzkchSE8EdzBN9iEes3O87q25 GbH1VLEtxBpI/n5eQuwBJJo= Received: (qmail 41789 invoked by alias); 7 Apr 2018 18:08:46 -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 41771 invoked by uid 89); 7 Apr 2018 18:08:45 -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, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=PROGRAM, H*M:40a1, Contributed, H*MI:40a1 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mo4-p00-ob.smtp.rzone.de Received: from mo4-p00-ob.smtp.rzone.de (HELO mo4-p00-ob.smtp.rzone.de) (85.215.255.20) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 07 Apr 2018 18:08:42 +0000 X-RZG-AUTH: :OGckYUunfvGNVUL0FlRnC4eRM+bOwx0tUtYTrJ/xeZX+ZVZvrbiROUdhOG6UdEk= X-RZG-CLASS-ID: mo00 Received: from [192.168.178.68] (xdsl-78-35-153-70.netcologne.de [78.35.153.70]) by smtp.strato.de (RZmta 43.1 DYNA|AUTH) with ESMTPSA id u09c50u37I8dCOe (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Sat, 7 Apr 2018 20:08:39 +0200 (CEST) To: gcc-patches , "fortran@gcc.gnu.org" From: =?utf-8?q?Thomas_K=C3=B6nig?= Subject: [patch, middle-end] Fix PR 82976, non-trivial conversion at assignment Message-ID: <0656c90b-7cdb-40a1-87af-7c44bea642d1@tkoenig.net> Date: Sat, 7 Apr 2018 20:08:39 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 Hello world, the attached patch fixes a middle-end bug, which caused a Fortran regression. The solution was given by Andrew on IRC and in the PR, I did the testing. Regression-tested with "configure --enable-languages=all" and "make -k check" on x86_64-pc-linux-gnu. OK for trunk? Regards Thomas 2018-04-07 Thomas Koenig Andrew Pinski PR middle-end/82976 * match.pd: Use constant_boolean_node of correct type instead of boolean_true_node or boolean_false_node for simplifying pointer comparisons to zero. 2018-04-07 Thomas Koenig PR middle-end/82976 * gfortran.dg/realloc_on_assign_16a.f90: New test. Index: match.pd =================================================================== --- match.pd (Revision 259152) +++ match.pd (Arbeitskopie) @@ -3700,7 +3700,7 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT) (neeq @0 @1) (if (POINTER_TYPE_P (TREE_TYPE (@0)) && ptrs_compare_unequal (@0, @1)) - { neeq == EQ_EXPR ? boolean_false_node : boolean_true_node; }))) + { constant_boolean_node (neeq != EQ_EXPR, type); }))) /* PR70920: Transform (intptr_t)x eq/ne CST to x eq/ne (typeof x) CST. and (typeof ptr_cst) x eq/ne ptr_cst to x eq/ne (typeof x) CST.