From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12619 invoked by alias); 20 Sep 2011 14:57:53 -0000 Received: (qmail 12606 invoked by uid 22791); 20 Sep 2011 14:57:50 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Sep 2011 14:57:33 +0000 From: "kargl at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/47023] [4.6/4.7 regression] C_Sizeof: Rejects valid code Date: Tue, 20 Sep 2011 15:40:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: kargl at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2011-09/txt/msg01393.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47023 --- Comment #4 from kargl at gcc dot gnu.org 2011-09-20 14:57:00 UTC --- (In reply to comment #3) > (In reply to comment #2) > > I'm seeing this bug even for an explicitly interoperable type (hence I'm not > > sure if this is really the same bug - I'm happy to file a new one if someone > > tells me to): > > > > print *, c_sizeof(0.0_c_double) > > 1 > > Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be be an interoperable > > data entity > > > > GNU Fortran (Ubuntu 4.6.0-1ubuntu1~ppa2) 4.6.1 20110326 (prerelease) > > This is now a regression. > > troutmask:sgk[208] gfc45 -o z foo.f90 > troutmask:sgk[209] ./z > 8 > troutmask:sgk[210] gfc46 -o z foo.f90 > foo.f90:3.25: > > print '(I0)', c_sizeof(0.0_c_double) > 1 > Error: 'x' argument of 'c_sizeof' intrinsic at (1) must be be an interoperable > data entity > > troutmask:sgk[211] cat foo.f90 > program foo > use iso_c_binding > print '(I0)', c_sizeof(0.0_c_double) > end program foo This seems to be a bug only when the actual argument is parameter. program foo use iso_c_binding real(c_double) x print *, c_sizeof(x) end program foo works as expected.