From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99882 invoked by alias); 21 Apr 2015 08:39:26 -0000 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 Received: (qmail 99860 invoked by uid 48); 21 Apr 2015 08:39:23 -0000 From: "roger.ferrer at bsc dot es" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/65825] New: Cannot change attributes intrinsic Date: Tue, 21 Apr 2015 08:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: roger.ferrer at bsc dot es X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-04/txt/msg01696.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65825 Bug ID: 65825 Summary: Cannot change attributes intrinsic Product: gcc Version: 4.9.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: roger.ferrer at bsc dot es Hi, a problem similar to PR57141 happens with the code below. Fails both with gfortran 4.9.2 and 5.0.1 20150412 (prerelease). Both Intel Fortran 14.0.2 and XL Fortran 15.01 accept this code (both print 3 of course). -- t.f90 MODULE moo IMPLICIT NONE INTEGER(4), PUBLIC :: c(3, 3) !! uncomment the following statement !! as a workaround ! PRIVATE :: ubound DATA c(3, 1:ubound(c, 2)) / 1, 2, 3 / END MODULE moo PROGRAM main USE moo IMPLICIT NONE INTEGER(4) :: x INTRINSIC :: ubound ! gfortran rejects this x = ubound(c, 2) ! should print 3 PRINT *, x END PROGRAM main -- end of t.f90 Leaving the upper bound of the subscript-triplet can be used as a workaround. Another workaround involves explicitly stating that ubound name is private. I assume that the code is OK since in both cases ubound does not change its "intrinsic" meaning. Kind regards,