From patchwork Sun May 26 03:58:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bud Davis X-Patchwork-Id: 246365 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 C1F7B2C0082 for ; Sun, 26 May 2013 13:58:29 +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:cc:in-reply-to:mime-version :content-type; q=dns; s=default; b=XaRedVfqc9bUQXWc1+DvNHfsN3Gja JY7z7B50DmoEmYQI7sU+O4LJGELYXiNCp0Uidf7EWSZRc49+LE0Pg6wESHroqEbc 5MUm6bsZhTI0mbHq9WhFVSYrZR341aOdNdV6dmRd1VOh6Jr4WOv/5AQSWt/YDK4q 3qOCvDWIOsXzRc= 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:cc:in-reply-to:mime-version :content-type; s=default; bh=xpT9rO83KOxiWy2AjAyo7ufTqQQ=; b=PlO w0R+Aw+ViWs3gKlZnFncPgkK6GYzk9h6VElFCf1dxu5i4H49boJKMJEP9Qf3a/1X ffexv/yrF4Xq8oeo1tJMsZlkVgWlWzIM2X71WnftU09e2MMbmmFIwDz8ykmvmIsx ZUegZxVRQ13+OJ5jZImbfGumRPlkh9dkLfNbGaIs= Received: (qmail 8378 invoked by alias); 26 May 2013 03:58:23 -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 8314 invoked by uid 89); 26 May 2013 03:58:15 -0000 X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_20, KHOP_THREADED, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1 Received: from nm21.access.bullet.mail.mud.yahoo.com (HELO nm21.access.bullet.mail.mud.yahoo.com) (66.94.237.222) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Sun, 26 May 2013 03:58:13 +0000 Received: from [66.94.237.197] by nm21.access.bullet.mail.mud.yahoo.com with NNFMP; 26 May 2013 03:58:11 -0000 Received: from [66.94.237.96] by tm8.access.bullet.mail.mud.yahoo.com with NNFMP; 26 May 2013 03:58:11 -0000 Received: from [127.0.0.1] by omp1001.access.mail.mud.yahoo.com with NNFMP; 26 May 2013 03:58:11 -0000 Received: (qmail 43768 invoked by uid 60001); 26 May 2013 03:58:11 -0000 Received: from [24.27.83.251] by web182204.mail.bf1.yahoo.com via HTTP; Sat, 25 May 2013 20:58:10 PDT Message-ID: <1369540690.43066.YahooMailClassic@web182204.mail.bf1.yahoo.com> Date: Sat, 25 May 2013 20:58:10 -0700 (PDT) From: Bud Davis Subject: Re: [patch, fortran] PR50405 - Statement function with itself as argument SEGV's To: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: Tobias Burnus In-Reply-To: <5195DA15.8060405@net-b.de> MIME-Version: 1.0 The changes suggested by: http://gcc.gnu.org/ml/fortran/2013-05/msg00057.html have been made in the below diff and test file. Could someone please commit this ? It has been approved, see the above referenced message. thanks, Bud Davis !{ dg-do compile } ! pr50405 ! submitted by zeccav@gmail.com !{ dg-prune-output "Obsolescent feature: Statement function at" } f(f) = 0 ! { dg-error "Self referential argument" } end 2013-05-26 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 199330) +++ 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);