From patchwork Fri May 17 03:22:48 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Bud Davis X-Patchwork-Id: 244464 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 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id D96CC2C007E for ; Fri, 17 May 2013 13:23:10 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:subject:to:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=waY+qYyHilnfD/C4 nxqitbGT9f6xfmvJ9fPbgYhAGmGyD4GtzF7ci7w4kroexe0xKsBbiuF4WgHWv72l vw04QfEkeE9x+DUmQl3XOM3x6wRBz2DtvZuyyOk14Pway9Pi7pykG+1puw5dxKLl 0z+BrwJF375J/CTajgGOWVCR80A= 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 :message-id:date:from:subject:to:mime-version:content-type :content-transfer-encoding; s=default; bh=wDlIMnE5VDhsTVxC0Ct5tI 6Qoh0=; b=tZtGNH+MCcwGjqcNgRsoC/oS8c47FelCA3N02Hj+KVAJ3uaTop2veK PfQysDdZXTZy/6dfUs1sFUPJ/bRhC+gmJjCyPPVNPh0jxFya2CL3W80H47v6aE7+ 86V5T8qDiDTI8NzkrVp+yG//bxmE75Hgnt/VRLz4iS2n8VCpERmgk= Received: (qmail 32580 invoked by alias); 17 May 2013 03:22:59 -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 32542 invoked by uid 89); 17 May 2013 03:22:52 -0000 X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from nm17.access.bullet.mail.mud.yahoo.com (HELO nm17.access.bullet.mail.mud.yahoo.com) (66.94.237.218) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Fri, 17 May 2013 03:22:51 +0000 Received: from [66.94.237.198] by nm17.access.bullet.mail.mud.yahoo.com with NNFMP; 17 May 2013 03:22:49 -0000 Received: from [66.94.237.120] by tm9.access.bullet.mail.mud.yahoo.com with NNFMP; 17 May 2013 03:22:49 -0000 Received: from [127.0.0.1] by omp1025.access.mail.mud.yahoo.com with NNFMP; 17 May 2013 03:22:49 -0000 Received: (qmail 56458 invoked by uid 60001); 17 May 2013 03:22:49 -0000 Received: from [24.27.83.251] by web182202.mail.bf1.yahoo.com via HTTP; Thu, 16 May 2013 20:22:48 PDT Message-ID: <1368760968.56247.YahooMailClassic@web182202.mail.bf1.yahoo.com> Date: Thu, 16 May 2013 20:22:48 -0700 (PDT) From: Bud Davis Subject: [patch, fortran] PR50405 - Statement function with itself as argument SEGV's To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org MIME-Version: 1.0 Not to much to add beyond the title and the patch. The test file fails before (eventually, when you run out of stack) and passes after the patch is applied.  No new testsuite failures. --bud !{ dg-do compile } ! submitted by zeccav@gmail.com !{ dg-prune-output "Obsolescent feature: Statement function at" } f(f) = 0 ! { dg-error "Self referential argument" } end 2013-05-17  Bud Davis          PR fortran/50405         resolve.c (resolve_formal_arglist): Detect error when an argument         has the same name as the function. Index: gcc/gcc/fortran/resolve.c =================================================================== --- gcc/gcc/fortran/resolve.c    (revision 198955) +++ gcc/gcc/fortran/resolve.c    (working copy) @@ -306,6 +306,14 @@            && !resolve_procedure_interface (sym))     return; +      if (strcmp (proc->name,sym->name) == 0) +        { +       gfc_error ("Self referential argument " +       "'%s' at %L is not allowed", sym->name, +       &proc->declared_at); +       return; +        } +        if (sym->attr.if_source != IFSRC_UNKNOWN)     resolve_formal_arglist (sym);