From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5456 invoked by alias); 17 Oct 2011 06:52:16 -0000 Received: (qmail 5440 invoked by uid 22791); 17 Oct 2011 06:52:15 -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; Mon, 17 Oct 2011 06:52:02 +0000 From: "burnus at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/50753] New: dshiftl/dshiftr: Rejects valid BOZ, accepts double BOZ Date: Mon, 17 Oct 2011 06:52: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-Keywords: accepts-invalid, rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: burnus 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: 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-10/txt/msg01577.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50753 Bug #: 50753 Summary: dshiftl/dshiftr: Rejects valid BOZ, accepts double BOZ Classification: Unclassified Product: gcc Version: 4.7.0 Status: UNCONFIRMED Keywords: accepts-invalid, rejects-valid Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned@gcc.gnu.org ReportedBy: burnus@gcc.gnu.org CC: kargl@gcc.gnu.org Found when checking PR fortran/50514: gfortran rejects: integer :: I, J print *, dshiftl(z'FFF', J, (bit_size(j)+1)) end with Error: 'j' argument of 'dshiftl' intrinsic at (1) must be the same type and kind as 'i' Expected: a) The BOZ is accepted b) There is a diagnostic as SHIFT is larger than BIT_SIZE(J). The same applies to DSHIFTR. >>From Fortran 2008's 13.7.50 DSHIFTL (I, J, SHIFT) "Arguments. I shall be of type integer or a boz-literal-constant. J shall be of type integer or a boz-literal-constant. If both I and J are of type integer, they shall have the same kind type parameter. I and J shall not both be boz-literal-constants. SHIFT shall be of type integer. It shall be nonnegative and less than or equal to BIT SIZE (I) if I is of type integer; otherwise, it shall be less than or equal to BIT SIZE (J)." Result Value. If either I or J is a boz-literal-constant, it is first converted as if by the intrinsic function INT to type integer with the kind type parameter of the other." * * * Additionally, the following is accepted but invalid: Only one BOZ is allowed: print *, dshiftl(z'FFF', z'AAA', 0) end I am not sure whether it should be allowed with -std=gnu, but none of my compilers diagnoses it correctly. (Well, except for ifort, which even rejects the example of the Fortran 2008 standard.)