From patchwork Sat Dec 15 11:09:15 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Koenig X-Patchwork-Id: 206612 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 98DFF2C0040 for ; Sat, 15 Dec 2012 22:09:37 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1356174578; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Message-ID:Date:From:User-Agent:MIME-Version:To:Subject: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=9lrdh0i jI+D0q4SjHKXjLZRiR1k=; b=V/+/w8haCr40CBpsS6oMXoOzLzr12cuHsejnCbj r78iy6eyCTeqlZy9QS4a24/CByjc1UdVssWFze24xSl/gHUi9rcL3vM5M67XpCBa Y8ZuA4j2VNF5aMhm2RGswNCYR6gMhuzdYKpSD06+sROqH0plVKmkYZAgaqtqj4Qi nhsw= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=yVJHuPl6axgaUSM3qoDhmDaPyH5mJTtx4S9+PSg53K5OZ8Tj95DW8B2SAUA8Q9 PczVQg8RJ5XsHU6646MUGP0SAVovXT5XATizx+RH8Er67ydwRN6vVRZ9IlcgSPwP ZasAGXeXwb4GIFvWy7pe+sdUz0UJm6wzslq6q0wEaiOf4=; Received: (qmail 19348 invoked by alias); 15 Dec 2012 11:09:27 -0000 Received: (qmail 19332 invoked by uid 22791); 15 Dec 2012 11:09:26 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_LOW, RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from cc-smtpout3.netcologne.de (HELO cc-smtpout3.netcologne.de) (89.1.8.213) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 15 Dec 2012 11:09:19 +0000 Received: from cc-smtpin3.netcologne.de (cc-smtpin3.netcologne.de [89.1.8.203]) by cc-smtpout3.netcologne.de (Postfix) with ESMTP id 323C8124D0; Sat, 15 Dec 2012 12:09:18 +0100 (CET) Received: from [192.168.0.104] (xdsl-78-35-146-188.netcologne.de [78.35.146.188]) by cc-smtpin3.netcologne.de (Postfix) with ESMTPSA id 0BF5511DC1; Sat, 15 Dec 2012 12:09:16 +0100 (CET) Message-ID: <50CC5A5B.8030603@netcologne.de> Date: Sat, 15 Dec 2012 12:09:15 +0100 From: Thomas Koenig User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0 MIME-Version: 1.0 To: "fortran@gcc.gnu.org" , gcc-patches Subject: [patch, libfortran] Fix PR 30162, write with pipes 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 Hello world, the attached patch fixes the regression and regtests cleanly. No test case because I could not find anything portable to create a FIFO in the testsuite. OK for trunk and 4.7? Thomas 2012-12-15 Thomas Koenig PR libfortran/30162 * io/unix.c (raw_tell): If the lseek is done on a non-seekable file, return 0. Index: frontend-passes.c =================================================================== --- frontend-passes.c (Revision 193793) +++ frontend-passes.c (Arbeitskopie) @@ -1277,8 +1277,12 @@ doloop_code (gfc_code **c, int *walk_subtrees ATTR break; case EXEC_CALL: - f = co->symtree->n.sym->formal; + if (co->resolved_sym == NULL) + break; + + f = co->resolved_sym->formal; + /* Withot a formal arglist, there is only unknown INTENT, which we don't check for. */ if (f == NULL)