Add a document that summarizes Fortran 202X's upcoming
features and their urgency for implementation.
Details
Diff Detail
Event Timeline
flang/docs/F202X.md | ||
---|---|---|
90–95 | I'd be curious to know if you have any examples of real world code that rely on the length of a buffer not changing, or would have meaningful different observable behaviour. In my experience the typical usage would be more like: character(:), allocatable :: buffer allocate(character(20)::buffer) write(buffer,'F5.3') 3.14159 print *, trim(buffer) which wouldn't show observably different behavior. Or at worst: character(:), allocatable :: buffer allocate(character(20)::buffer) write(buffer,'F5.3') 3.14159 print *, buffer where it is observably different (no more trailing blanks), but is likely to be a welcome change, not an unwelcome one. |
flang/docs/F202X.md | ||
---|---|---|
90–95 | I'm going to have to add portability warnings for usage of deferred-length character allocatables in these contexts and see how often they are triggered by nonclassified codes in order to give you an accurate reproducible answer to that. Part of the difficulty here is that this isn't usage that can be easily grepped for. |
flang/docs/F202X.md | ||
---|---|---|
90–95 | I think you're going to get a lot of false positives that way. I suspect the majority of cases will be from code that looks like: character(:), allocatable :: buffer allocate(character(1000) :: buffer) write(buffer, 'F5.3') 3.14159 buffer = trim(buffer) and are going to go, oh good, I can delete those two lines and just write: character(:), allocatable :: buffer write(buffer, 'F5.3') 3.14159 Now how do I turn the warning off? I'll tell you right now I'm in that camp. My reading of your answer is either:
|
Thanks for putting up this document. Very informative and likely good feedback for standards committee members. I see that Brad has already commented, may be Mark and Gary also might be interested.
A comment on the source line changes, relaxation for BOZ constants, using rank-one arrays to specify the rank and bounds of arrays might be useful.
flang/docs/F202X.md | ||
---|---|---|
140 | There might be some performance benefits if lowering can use llvm attributes like argmem/argmemonly for simple functions. | |
198 | Is Select case support for enumeration types new? |
F18 has always had no limit on free from source line length; are there other source line changes that I missed?
The BOZ literal changes originated in other implementations and they should already work in f18. Some compilers allow BOZ as output statement I/O data items, and that is intentionally not supported.
I did miss the thing about using vectors for bounds in array declarations; will read up on that and add it. Thanks for the tip!
flang/docs/F202X.md | ||
---|---|---|
140 | My understanding is that calls to PURE procedures could use memory(read, argmem:readwrite, inaccessiblemem:readwrite) and SIMPLE could drop the read. Is that also what you have in mind? Calls to SIMPLE procedures from DO CONCURRENT are also safe from the bug that feature has with PURE procedures. | |
198 | It must be, since ENUMERATION TYPE is new in F202X. |
For both these (line-length and BOZ) I was thinking a statement like the above will be good for conveying the status of these features.
There is probably a requirement to provide warnings or errors if these limits are breached for source line length.
6.3.2.1 A line shall contain at most ten thousand characters.
6.3.2.6 A statement shall not have more than one million characters.
I did miss the thing about using vectors for bounds in array declarations; will read up on that and add it. Thanks for the tip!
flang/docs/F202X.md | ||
---|---|---|
140 | Yes, I am hoping that the argument-only memory access might help enable more optimisation since it does not access any global memory. We have seen in the past a case where there are two usages of the same pure function with the same arguments and it required classic-flang to provide the memory attributes to do a CSE. bose_f in the following example. |
Fortran compilers are supposed to check numbered constraints and report on violations, but "shall"s in other text are optional. (And it's all on the honor system anyway -- there's no validation test suite or certification process.)
The 10,000 character limit per line would be easy to check, but the statement limit on characters would require some thought and would cost more than o(statements).
I'd be curious to know if you have any examples of real world code that rely on the length of a buffer not changing, or would have meaningful different observable behaviour. In my experience the typical usage would be more like:
which wouldn't show observably different behavior. Or at worst:
where it is observably different (no more trailing blanks), but is likely to be a welcome change, not an unwelcome one.