This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/81509] New: Wrong compilation error: iand/ieor/ior + boz + -std=f2008


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81509

            Bug ID: 81509
           Summary: Wrong compilation error: iand/ieor/ior + boz +
                    -std=f2008
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ripero84 at gmail dot com
  Target Milestone: ---

Created attachment 41805
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=41805&action=edit
Example source code

When the following three conditions are met
(a) call to the intrinsic function IAND, IEOR, or IOR, and
(b) one of its arguments is a boz-literal-constant, and
(c) the -std=f2008 compilation flag is used,
for example,

    write(*,*)  ior(b'001011101',5)

compilation aborts with the compilation error:

    Error: GNU Extension: Different type kinds at (1)

with (1) also written below the left parenthesis after the intrinsic function.

This should not be an error, since the 2008 version of the Fortran standard
permits this: paragraph 3 "Arguments" of the subsections that define IAND(I,J),
IEOR(I,J), and IOR(I,J) (13.7.72, 13.7.78, and 13.7.82, respectively) say:

"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."

Note that the cause for the error would not even make sense:
boz-literal-constants don't have a type (as per paragraph 1, section 4.7 of the
2008 standard), and therefore they could not have a type kind that could match
or not the type kind of the other argument of the intrinsic function.

I am experiencing this with versions 6.4.0 and 7.1.0 - please see the
attachments for an example that explores all combinations of boz constants and
intrinsics, and the respective compiler outputs with detailed version
information.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]