From patchwork Mon Jul 26 07:20:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Dominique_d=27Humi=C3=A8res?= X-Patchwork-Id: 59893 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 7E55EB6F10 for ; Mon, 26 Jul 2010 17:20:32 +1000 (EST) Received: (qmail 20712 invoked by alias); 26 Jul 2010 07:20:27 -0000 Received: (qmail 20689 invoked by uid 22791); 26 Jul 2010 07:20:26 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL, BAYES_20, RCVD_IN_DNSWL_LOW, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nef2.ens.fr (HELO nef2.ens.fr) (129.199.96.40) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 26 Jul 2010 07:20:14 +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 o6Q7KB1Y011283 ; Mon, 26 Jul 2010 09:20:11 +0200 (CEST) X-Envelope-To: janus@gcc.gnu.org Received: from localhost (localhost [127.0.0.1]) by mailhost.lps.ens.fr (Postfix) with ESMTP id 4BE6A3BE0A; Mon, 26 Jul 2010 09:20:11 +0200 (CEST) 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 0yvqooYtnIiI; Mon, 26 Jul 2010 09:20:11 +0200 (CEST) Received: by mailhost.lps.ens.fr (Postfix, from userid 8513) id 37BB43BE18; Mon, 26 Jul 2010 09:20:11 +0200 (CEST) Date: Mon, 26 Jul 2010 09:20:11 +0200 To: fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org, burnus@net-b.de, janus@gcc.gnu.org Subject: Re: [Patch, Fortran, OOP] PR 44962: [OOP] ICE with specification expression SIZE() User-Agent: Heirloom mailx 12.4pre 6/29/08 MIME-Version: 1.0 Message-Id: <20100726072011.37BB43BE18@mailhost.lps.ens.fr> From: dominiq@lps.ens.fr (Dominique Dhumieres) 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 Janus, I just noticed that you have changed the test typebound_proc_17.f03 between revisions of your patch: (where I have added the last 4 '-' lines for testing as commented below). With the latest patch the line real, dimension(irand()+5) :: co2 ! { dg-error "must be constant" } in "type :: t2" no longer triggers the error. Is it according the last lines of f2008 [7.1.11] quoted by Tobias Burnus? If yes, is it normal that "print *, size(a%co2)" yields 0? Also when compiled with -std=f2003, both versions give the error: real, dimension(irand()+*) :: * ! { dg-error "must *" } 1 Error: Specification function 'irand' at (1) must be PURE Has this constraint been removed in f2008? Finally, as I said in a previous post, the *rand functions are g77 extensions and their use should probably discouraged in post f90 codes. If the issues raised by Tobias appear only for these functions, is it really necessary to spend too much time on them? Cheers, Dominique --- typebound_proc_17_old.f03 2010-07-26 07:45:13.000000000 +0200 +++ /opt/gcc/work/gcc/testsuite/gfortran.dg/typebound_proc_17.f03 2010-07-26 07:15:54.000000000 +0200 @@ -24,14 +24,11 @@ end module array type :: t2 - real, dimension(irand()+5) :: co2 ! { dg-error "must be constant" } + real, dimension(iabs(-3)+2) :: com end type -type(t2) :: a +real, dimension(irand()+2) :: r2 ! { dg-error "must have constant shape" } -print *, size(a%co2) -a%co2 = 1.0 -print *, a end ! { dg-final { cleanup-modules "array" } }