From patchwork Wed Aug 18 05:58:13 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Richard Thomas X-Patchwork-Id: 62000 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]) by ozlabs.org (Postfix) with SMTP id 35937B70D3 for ; Wed, 18 Aug 2010 15:58:27 +1000 (EST) Received: (qmail 30153 invoked by alias); 18 Aug 2010 05:58:22 -0000 Received: (qmail 30135 invoked by uid 22791); 18 Aug 2010 05:58:21 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-bw0-f47.google.com (HELO mail-bw0-f47.google.com) (209.85.214.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 05:58:16 +0000 Received: by bwz12 with SMTP id 12so289924bwz.20 for ; Tue, 17 Aug 2010 22:58:13 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.79.199 with SMTP id q7mr5175035bkk.76.1282111093549; Tue, 17 Aug 2010 22:58:13 -0700 (PDT) Received: by 10.204.68.209 with HTTP; Tue, 17 Aug 2010 22:58:13 -0700 (PDT) In-Reply-To: <4C69F243.4090001@verizon.net> References: <4C69F243.4090001@verizon.net> Date: Wed, 18 Aug 2010 07:58:13 +0200 Message-ID: Subject: Re: [patch, fortran] PR41859 ICE on invalid expression involving DT with pointer components in I/O From: Paul Richard Thomas To: Jerry DeLisle Cc: gfortran , gcc patches 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 Dear Jerry, > OK for trunk? OK but for one tiny question: Should you not check for parentheses, just to stop the code trying to charge down, for example, binary operators? Since expr1 has been resolved already at the top of resolve_code, this should not matter - it's just unnecessary. eg. Thanks for the patch! Paul sym = exp->symtree->n.sym; Index: resolve.c =================================================================== --- resolve.c (revision 163259) +++ resolve.c (working copy) @@ -7696,7 +7696,11 @@ resolve_transfer (gfc_code *code) exp = code->expr1; - if (exp->expr_type != EXPR_VARIABLE && exp->expr_type != EXPR_FUNCTION) + while (exp != NULL && exp->expr_type == EXPR_OP && exp->value.op.op == INTRINSIC_PARENTHESES) + exp = exp->value.op.op1; + + if (exp == NULL || (exp->expr_type != EXPR_VARIABLE + && exp->expr_type != EXPR_FUNCTION)) return;