This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/81509] New: Wrong compilation error: iand/ieor/ior + boz + -std=f2008
- From: "ripero84 at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 21 Jul 2017 16:28:25 +0000
- Subject: [Bug fortran/81509] New: Wrong compilation error: iand/ieor/ior + boz + -std=f2008
- Auto-submitted: auto-generated
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.