From patchwork Sat Nov 14 13:51:08 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Dominique_d=27Humi=C3=A8res?= X-Patchwork-Id: 544753 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 A203F1412E6 for ; Sun, 15 Nov 2015 00:51:25 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=JoGVqn2I; 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:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; q=dns; s=default; b=Jo6rKK6NWhxCj21P24MSAuz eCPWccoXUPFXTmc5fKUlvq21uguFmoAWHsagFZUF2rwhwxTEHHCJre2Ue+sBm7q5 n9YTVAHB/1jRW7BxNH7q/VedbX5FjRkPcidgPKpNrn0kwjJ3allt1piiqA6VabZY NgzZy7kRLiPMzW635+wQ= 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:from :content-type:content-transfer-encoding:subject:date:message-id :cc:to:mime-version; s=default; bh=OsH0nsoDygl1AUKr8bPnLh/RNUw=; b= JoGVqn2IkVjXGRhu/Fvey1MgiHOGghJUsu+a0IJslyO+Mwq/CiwccHW9r9Xz0dKK xXySKK8QGt4s6EJQR9CvEmCQbkrbOce/NISLWwF11pzMolxdPY556WydimTDgGaO oF4qyNoI7KnV8hZyjj+dKUOWSBkOXZzAzxkyIJY5zS0= Received: (qmail 87981 invoked by alias); 14 Nov 2015 13:51:18 -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 87958 invoked by uid 89); 14 Nov 2015 13:51:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.8 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 3 recipients X-HELO: nef2.ens.fr Received: from nef2.ens.fr (HELO nef2.ens.fr) (129.199.96.40) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 14 Nov 2015 13:51:15 +0000 Received: from mailhost.lps.ens.fr (tournesol.lps.ens.fr [129.199.120.1]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id tAEDpAL5035451 ; Sat, 14 Nov 2015 14:51:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mailhost.lps.ens.fr (Postfix) with ESMTP id 34F01228; Sat, 14 Nov 2015 14:51:10 +0100 (CET) Received: from mailhost.lps.ens.fr ([127.0.0.1]) by localhost (tournesol.lps.ens.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Zrj4klVLZoGQ; Sat, 14 Nov 2015 14:51:10 +0100 (CET) Received: from [192.168.1.14] (log78-1-82-242-47-10.fbx.proxad.net [82.242.47.10]) by mailhost.lps.ens.fr (Postfix) with ESMTPSA id 1A1D8226; Sat, 14 Nov 2015 14:51:09 +0100 (CET) From: =?utf-8?Q?Dominique_d=27Humi=C3=A8res?= Subject: Re: [PATCH] PR fortran/68283 -- remove a rogue gfc_internal_error() Date: Sat, 14 Nov 2015 14:51:08 +0100 Message-Id: Cc: jvdelisle@charter.net, tkoenig@gcc.gnu.org, Paul Richard Thomas , fortran@gcc.gnu.org, gcc-patches To: Steve Kargl Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2104\)) Hi Steve, Although I have not strong objection to your proposed patch, I’ld prefer the following one Now both patches are just papering over the real issues: (1) Why is this block reached when compiling with -ffrontend-optimize, but not with -fno-frontend-optimize (Thomas)? (2) Is there expected side effect(s) when removing the' for‘ block introduced at revision r221955 for pr56852 (Paul)? Dominique --- ../_clean/gcc/fortran/primary.c 2015-10-18 13:07:28.000000000 +0200 +++ gcc/fortran/primary.c 2015-11-13 23:32:08.000000000 +0100 @@ -2194,7 +2194,7 @@ check_substring: symbol_attribute gfc_variable_attr (gfc_expr *expr, gfc_typespec *ts) { - int dimension, codimension, pointer, allocatable, target, n; + int dimension, codimension, pointer, allocatable, target; symbol_attribute attr; gfc_ref *ref; gfc_symbol *sym; @@ -2253,22 +2253,9 @@ gfc_variable_attr (gfc_expr *expr, gfc_t case AR_UNKNOWN: /* If any of start, end or stride is not integer, there will already have been an error issued. */ - for (n = 0; n < ref->u.ar.as->rank; n++) - { - int errors; - gfc_get_errors (NULL, &errors); - if (((ref->u.ar.start[n] - && ref->u.ar.start[n]->ts.type == BT_UNKNOWN) - || - (ref->u.ar.end[n] - && ref->u.ar.end[n]->ts.type == BT_UNKNOWN) - || - (ref->u.ar.stride[n] - && ref->u.ar.stride[n]->ts.type == BT_UNKNOWN)) - && errors > 0) - break; - } - if (n == ref->u.ar.as->rank) + int errors; + gfc_get_errors (NULL, &errors); + if (errors == 0) gfc_internal_error ("gfc_variable_attr(): Bad array reference"); }