From patchwork Sun Feb 19 18:44:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andre Vehreschild X-Patchwork-Id: 729584 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 3vRG0R0rq2z9s7w for ; Mon, 20 Feb 2017 05:45:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Ov44hv1l"; 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:date :from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-type; q=dns; s=default; b=YdCS8wfAVMZrrP31 n6epZnipZ00sCy333wL95fBUKnZg4QbZGcRYd8AXFxo+AGyyhKe686jbZXzeLgU5 4XISTy8OT5YwBB+rdDG0VPzIblPERi3R/lksK02gUOfGjwvYF8XItdVU2Z/ed9/u gdSCuuw8ZNCXzXpoIqTGFcOVX3E= 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:cc:subject:message-id:in-reply-to:references :mime-version:content-type; s=default; bh=oEtQmpSYu964+qD4qEQtCT ftnU8=; b=Ov44hv1luUoG5j1KTlv4EGtfQsFqe66iIXbcNAwPW7qVID4oN9YteE XZq4tncClYkNvrMNqMfCREqBAxg9gtvqFt2bj0WHDgnqdPLlNssHfBN9LIzsUHVI xoSLv6FAKeiNkeQ7wh06L+DqcjrGuQTN0s3wgDtX3703WFusqhw2c= Received: (qmail 107407 invoked by alias); 19 Feb 2017 18:44:55 -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 107387 invoked by uid 89); 19 Feb 2017 18:44:54 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-8.6 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM, RCVD_IN_SORBS_WEB, SPF_PASS autolearn=ham version=3.3.2 spammy=nicht, H*f:sk:2435f3f, H*MI:sk:2435f3f, H*i:sk:2435f3f X-Spam-User: qpsmtpd, 2 recipients X-HELO: mout.gmx.net Received: from mout.gmx.net (HELO mout.gmx.net) (212.227.17.21) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 19 Feb 2017 18:44:52 +0000 Received: from vepi2 ([84.63.213.96]) by mail.gmx.com (mrgmx102 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M0Kp7-1cMLUg3EFB-00uVl4; Sun, 19 Feb 2017 19:44:48 +0100 Date: Sun, 19 Feb 2017 19:44:46 +0100 From: Andre Vehreschild To: Jerry DeLisle Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [Ping, PATCH, Fortran, 79229, v1] [7 Regression] ICE in gfc_trans_assignment_1 with -fcheck=mem Message-ID: <20170219194446.69c17240@vepi2> In-Reply-To: <2435f3f8-7e7b-1b7e-257f-586b0dce6280@charter.net> References: <20170207083122.40535d99@nb-vehre.private> <20170219174235.7b083dc3@vepi2> <2435f3f8-7e7b-1b7e-257f-586b0dce6280@charter.net> MIME-Version: 1.0 X-UI-Out-Filterresults: notjunk:1; V01:K0:JMIgk/slq3k=:oQAntXwkjhUbLlJY7vnJZQ sLI72gpoEbIjvRFOGj0W6Ex0J0mZ+bBM4xBk7FrZceeRNguSWmK0otc3sbfG3ZT7hI2bzvg1B QfNbDfjfCLQ6uBSoRJEvMujEcIaZmOc1Cn4qETyalpMfVVrPhVr8AhkI68q73Ayydqb7jl5kx pAoASd5ZlZVqY7n5Q6xN63wSKFjCmpqU6WUmItYyXyBAE5/rCnsP8jbs3jD/U6szjWh0YZU4l d8Wf64kfdoMHSqNP4DkP6E/esBTkvhRKnoL1fjd2aKs81HAxqU4uBAeTBlZ7qAPnPYFceCJG9 2ceSjw7PNHAubrnTcwXL7UKHsID8ncKq569RurpY/efndwohR4TBKrbKIqWDZ55FFX2vm5fOg UX9JcfZFo4e6vn+IRYt2iVjWaj/yY4cyOfMozqhqKea+Jq2J+bji54U/jFsfZAOuGMyGr88uJ Xn5JgqPG5Zg9E4iq/iVNwu0DGV2Rwz0v43O1GgwyYAyiLNSBHJV+1bR0kVb4ycZDugWqqHHTX kDwFBLaMfK23CR8Phf6xpHbE6W+0vkm3+BPZoetM0cfmgBwE/s0+CNrE7c8gPBEnIcTKgN2xW xbleTNjo6Q/6BzET8eOtmAXKKGZ66WmClwgoQAZLVaqmZwfVc8MmKh50wH9s7viT2r4MtDD6d Wrz4ReRXtTbWu4kHQKhQ7SQdFoIF5y7hhnRyRzLc9q3y+TFOIXsLRmV9Wf0c0PfgorK0WG630 8yE0ZKrRLN5KzxzKys8rGzsujpElWa270wF0Z7iEMQk9zm7njX6PtfhnZXs= Hi Jerry, hi all, thanks for the review. Committed as r245581. Regards, Andre On Sun, 19 Feb 2017 08:58:46 -0800 Jerry DeLisle wrote: > On 02/19/2017 08:42 AM, Andre Vehreschild wrote: > > Ping! > > > > this time with correct PR number: 79229. > > > > On Tue, 7 Feb 2017 08:31:22 +0100 > > Andre Vehreschild wrote: > > > >> Hi all, > >> > >> attached patch fixes the issue of 79229 (which is not a regression). > >> The issue was that the code generating the checking was expecting a > >> pointer type, but got an indirect ref to it. This is fixed now. > >> > >> Bootstraps and regtests ok on x86_64-linux/f25. Ok for trunk? > >> > >> Regards, > >> Andre > > > > > > This is OK, > > Jerry Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 245580) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -7,6 +7,12 @@ 2017-02-19 Andre Vehreschild + PR fortran/79229 + * trans-expr.c (gfc_trans_assignment_1): Deref indirect refs when + compiling with -fcheck=mem to check the pointer and not the data. + +2017-02-19 Andre Vehreschild + PR fortran/79335 * trans-array.c (duplicate_allocatable_coarray): Ensure attributes passed are properly initialized. Index: gcc/fortran/trans-expr.c =================================================================== --- gcc/fortran/trans-expr.c (Revision 245580) +++ gcc/fortran/trans-expr.c (Arbeitskopie) @@ -9961,13 +9961,16 @@ tree cond; const char* msg; + tmp = INDIRECT_REF_P (lse.expr) + ? gfc_build_addr_expr (NULL_TREE, lse.expr) : lse.expr; + /* We should only get array references here. */ - gcc_assert (TREE_CODE (lse.expr) == POINTER_PLUS_EXPR - || TREE_CODE (lse.expr) == ARRAY_REF); + gcc_assert (TREE_CODE (tmp) == POINTER_PLUS_EXPR + || TREE_CODE (tmp) == ARRAY_REF); /* 'tmp' is either the pointer to the array(POINTER_PLUS_EXPR) or the array itself(ARRAY_REF). */ - tmp = TREE_OPERAND (lse.expr, 0); + tmp = TREE_OPERAND (tmp, 0); /* Provide the address of the array. */ if (TREE_CODE (lse.expr) == ARRAY_REF) Index: gcc/testsuite/ChangeLog =================================================================== --- gcc/testsuite/ChangeLog (Revision 245580) +++ gcc/testsuite/ChangeLog (Arbeitskopie) @@ -1,3 +1,8 @@ +2017-02-19 Andre Vehreschild + + PR fortran/79229 + * gfortran.dg/class_allocate_24.f90: New test. + 2017-02-19 Paul Thomas PR fortran/79402 Index: gcc/testsuite/gfortran.dg/class_allocate_24.f90 =================================================================== --- gcc/testsuite/gfortran.dg/class_allocate_24.f90 (nicht existent) +++ gcc/testsuite/gfortran.dg/class_allocate_24.f90 (Arbeitskopie) @@ -0,0 +1,16 @@ +! { dg-do compile } +! { dg-options "-fcheck=mem" } +! +! Compile time check only, to test that the ICE is fixed in the assignment of the +! default initializer of the class to sf. + +implicit none + +type :: t + integer, pointer :: data => null () +end type + +class(t), dimension(:), allocatable :: sf +allocate (t :: sf (1)) +end +