Jinxin (Brian) Yang [Thu, 11 Jul 2019 23:32:34 +0000 (16:32 -0700)]
[flang] Merge pull request flang-compiler/f18#566 from flang-compiler/by-mp-validity
Add missing THREADS and SIMD clauses
Original-commit: flang-compiler/f18@
ade72d803d2b795d30244a4f9e72c5f26dafd454
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
peter klausler [Thu, 11 Jul 2019 20:54:12 +0000 (13:54 -0700)]
[flang] Ensure that no OMP clause is a prefix of a later one in the grammar; then alphabetize the order.
Original-commit: flang-compiler/f18@
7f4b4f8e74d003e87523ae62e7c1a82b8441299a
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
Jinxin Yang [Thu, 11 Jul 2019 19:19:51 +0000 (12:19 -0700)]
[flang] add ORDERED construct w/ THREADS and SIMD clauses (parse error)
Original-commit: flang-compiler/f18@
23a71aed74ee34ddd4dbf80ac3f906bf8c255bd9
Reviewed-on: https://github.com/flang-compiler/f18/pull/566
Tree-same-pre-rewrite: false
Jinxin (Brian) Yang [Thu, 11 Jul 2019 22:18:09 +0000 (15:18 -0700)]
[flang] Examples of Composite and Combined constructs (flang-compiler/f18#558)
* Examples of Composite and Combined constructs
2.8.3 Loop SIMD Construct
2.11.1 Parallel Loop Construct
2.11.3 Parallel Loop SIMD Construct
Not in the implementation:
2.8.3 DO SIMD: A list item may appear in a linear or firstprivate clause but not both
Original-commit: flang-compiler/f18@
75d9c1a081474c02a3e106ac13924134e06793ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/558
Peter Klausler [Thu, 11 Jul 2019 20:00:21 +0000 (13:00 -0700)]
[flang] Merge pull request flang-compiler/f18#561 from flang-compiler/pmk-fixes
Better name resolution for intrinsics
Original-commit: flang-compiler/f18@
33aceaec8f1fffbaa959806fea479af6bf602a6b
Reviewed-on: https://github.com/flang-compiler/f18/pull/561
peter klausler [Thu, 11 Jul 2019 18:34:01 +0000 (11:34 -0700)]
[flang] Better name resolution for intrinsics
Original-commit: flang-compiler/f18@
31fd9c82e9bd90b03bd37accd3d9f187ccbfa979
Reviewed-on: https://github.com/flang-compiler/f18/pull/561
Tim Keith [Thu, 11 Jul 2019 15:52:52 +0000 (08:52 -0700)]
[flang] Merge pull request flang-compiler/f18#559 from flang-compiler/tsk-symbols3
Move some functions to semantics/tools.h
Original-commit: flang-compiler/f18@
e133247901d9618cca73dd5557923ff642da93cb
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tim Keith [Thu, 11 Jul 2019 13:29:31 +0000 (06:29 -0700)]
[flang] Change two member functions of DerivedTypeDetails to non-member
In `OrderParameterNames` and `OrderParameterDeclarations` it was
always true that `this == &type.get<DerivedTypeDetails>()` which
meant that `this` was redundant.
So convert them to non-member functions in `tools.h` that get the
details from the symbol passed in. This makes life simpler for the
callers.
Original-commit: flang-compiler/f18@
81710d4e6ec9e316d95b955a1efd253d9c485fef
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tim Keith [Thu, 11 Jul 2019 01:20:27 +0000 (18:20 -0700)]
[flang] Move various Instantiate functions to tools.cc
Move these functions from scope.cc, symbol.cc, type.cc into tools.cc:
Scope::FindOrInstantiateDerivedType
Scope::InstantiateDerivedType
Scope::InstantiateIntrinsicType
Symbol::Instantiate
DerivedTypeSpec::ProcessParameterExpressions
DerivedTypeSpec::Instantiate
This eliminates some dependencies in these files on SemanticsContext,
FoldingContext, etc.
It also allows three of the functions to be private to tools.cc
because they are only called from the others.
Original-commit: flang-compiler/f18@
48c6efbf95390446fa10ca61b3e7f6b7db6c836d
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tree-same-pre-rewrite: false
Tim Keith [Thu, 11 Jul 2019 00:49:28 +0000 (17:49 -0700)]
[flang] Fix formatting
Original-commit: flang-compiler/f18@
bef7ddd43b155417657aefaf284ffc1b28d2b8d6
Reviewed-on: https://github.com/flang-compiler/f18/pull/559
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 10 Jul 2019 23:50:43 +0000 (16:50 -0700)]
[flang] Merge pull request flang-compiler/f18#557 from flang-compiler/pmk-fixes
Fix name resolution for direct recursion; adjust BOZ arguments to intrinsics.
Original-commit: flang-compiler/f18@
537a501f4770a07a99a80639a11db803ee44e9a2
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
peter klausler [Wed, 10 Jul 2019 23:41:18 +0000 (16:41 -0700)]
[flang] Update grammar and a test in light of C1516
Original-commit: flang-compiler/f18@
df4ddccde7e3f8caf9dc3784396b1ee419df5099
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
peter klausler [Wed, 10 Jul 2019 22:05:13 +0000 (15:05 -0700)]
[flang] Add -fxor-operator
Original-commit: flang-compiler/f18@
b8365afc91f8e99c2e4cfb79d8ea9bf60a4b99f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Wed, 10 Jul 2019 22:04:51 +0000 (15:04 -0700)]
[flang] Update tests
Original-commit: flang-compiler/f18@
aa18f1bca5ad918d0cb92735b9557c4b5217262e
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Wed, 10 Jul 2019 22:04:39 +0000 (15:04 -0700)]
[flang] Fix name resolution with directly recursive calls.
Original-commit: flang-compiler/f18@
b8e8610430049e9b1da1d4df0c942310d06ac3b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Wed, 10 Jul 2019 22:03:53 +0000 (15:03 -0700)]
[flang] Do not emit PROCEDURE(TYPE(REAL)), pgf90 cannot deal. Use PROCEDURE(REAL).
Original-commit: flang-compiler/f18@
ee5f3923814b6f85262bf2dfa43371126f07305f
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Wed, 10 Jul 2019 22:03:02 +0000 (15:03 -0700)]
[flang] Document preprocessing of Fortran comments in macro actual args
Original-commit: flang-compiler/f18@
f491b73636fe95ede63d9f402d14e6f29250f95b
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Tue, 9 Jul 2019 18:54:11 +0000 (11:54 -0700)]
[flang] Allow BOZ argument to more intrinsics; generalize BOZ conversions in folding
Original-commit: flang-compiler/f18@
6df0136ee889f3c27b33d3ddac970af1b7a52c68
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Tue, 9 Jul 2019 18:53:29 +0000 (11:53 -0700)]
[flang] Remove reference to EUC_JP from test
Original-commit: flang-compiler/f18@
ca5c812994a4dd3ea948d54a62a4271dceef3fce
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
peter klausler [Tue, 9 Jul 2019 18:53:11 +0000 (11:53 -0700)]
[flang] Update extension documentation
Original-commit: flang-compiler/f18@
40b44b2e3a087fad4f95009c6e7b345dab970fbb
Reviewed-on: https://github.com/flang-compiler/f18/pull/557
Tree-same-pre-rewrite: false
psteinfeld [Wed, 10 Jul 2019 20:02:52 +0000 (13:02 -0700)]
[flang] Merge pull request flang-compiler/f18#551 from flang-compiler/ps-shared-locality
Enabling automatic declaration of names in SHARED locality-spec's
Original-commit: flang-compiler/f18@
b553d3857cb38044fcada5641635c8045f514ab0
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Peter Steinfeld [Wed, 10 Jul 2019 19:53:03 +0000 (12:53 -0700)]
[flang] Improved warning message base on feedback from Peter.
Original-commit: flang-compiler/f18@
030f36432455e48996bd200df5e5c5d6f1d4ef53
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Peter Steinfeld [Tue, 9 Jul 2019 16:15:10 +0000 (09:15 -0700)]
[flang] Changed the warning as recommended.
Original-commit: flang-compiler/f18@
7887331705113619c0710f7052da390b2ac188e3
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
Peter Steinfeld [Mon, 8 Jul 2019 22:35:24 +0000 (15:35 -0700)]
[flang] Changes related to feedback from pull request flang-compiler/f18#551
- Changed the name a a function to FindOrDeclareEnclosingEntity
- Changed that function to return a reference rather than a pointer
- Polished the setting of the IMPLICIT flag on a declared entity in a
locality-spec
- Changed a test to remove an unreported error
Original-commit: flang-compiler/f18@
0c1a00d7c2c67064801f9f6fb37c0a26224c0ea4
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
Peter Steinfeld [Thu, 4 Jul 2019 00:14:12 +0000 (17:14 -0700)]
[flang] Enabling automatic declaration of names in SHARED locality-spec's
Prior to this change, the compiler issued an error message when a name in a
SHARED locality-spec had not been declared explicitly in an enclosing scope.
Presumably, this was done to enforce constraint C1124. This constraint states
that "A variable-name in a locality-spec shall be the name of a variable in the
innermost executable construct or scoping unit that includes the DO CONCURRENT
statement". For LOCAL and LOCAL_INIT locality-spec's, we were automatically
creating a local variable in the situation where one had not been explicitly
declared rather than issuing an error message.
The only compiler I could find that implements the SHARED locality-spec was the
PGI compiler, which automatically creates a variable and does not emit an error
message. Also, @vdonaldson said that he had consulted with a member of the
Fortran standards committee who said that the correct thing was to create a
variable if necessary.
This change has the compiler creating a variable in the enclosing scope of a DO
CONCURRENT statement if necessary. I also changed a test to adapt to the new
behavior. I also consolidated the semantic checking for the constraints
associated with all of the locality-spec's.
Original-commit: flang-compiler/f18@
d9253a76fcbc49df11c017557b365dfeed7c2b3b
Reviewed-on: https://github.com/flang-compiler/f18/pull/551
Tree-same-pre-rewrite: false
Jinxin (Brian) Yang [Tue, 9 Jul 2019 21:08:50 +0000 (14:08 -0700)]
[flang] 2.8.1 SIMD structural checks (flang-compiler/f18#554)
Straightforward implementation but not including:
* list-item on aligned clause
* nesting check with the ordered construct (parse tree changes needed!)
* list-item attributes check on aligned clause
Original-commit: flang-compiler/f18@
cf04d8ad26fc392822335a529430afb65421d7b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/554
Peter Klausler [Mon, 8 Jul 2019 23:16:55 +0000 (16:16 -0700)]
[flang] Merge pull request flang-compiler/f18#553 from flang-compiler/pmk-fixes
Support "*length" character length specifier on declarations, plus a couple small fixes.
Original-commit: flang-compiler/f18@
afe12f7f4b36ad3c1f798a658f1febcfd7eb1caf
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
peter klausler [Mon, 8 Jul 2019 23:02:50 +0000 (16:02 -0700)]
[flang] Fix regressions found in testing
Original-commit: flang-compiler/f18@
ea09b191dfbcb00097a44df3aae3bdbd5f6e8392
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
peter klausler [Mon, 8 Jul 2019 21:07:56 +0000 (14:07 -0700)]
[flang] Support *length character length specifiers
Original-commit: flang-compiler/f18@
874b13b7d85837ddf9b76568ee3cd41cf28eb19b
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
peter klausler [Mon, 8 Jul 2019 17:44:43 +0000 (10:44 -0700)]
[flang] Resolve merge
Original-commit: flang-compiler/f18@
44743f1fa9377ec6d5929dfe2227295d33ca5673
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
peter klausler [Mon, 8 Jul 2019 17:44:14 +0000 (10:44 -0700)]
[flang] Document non-standard use of larger INTEGER for sizes
Original-commit: flang-compiler/f18@
edc79c4257079378df534247858832dba7a35920
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
peter klausler [Mon, 8 Jul 2019 17:43:42 +0000 (10:43 -0700)]
[flang] Fix multi-file compilations in throwaway driver
Original-commit: flang-compiler/f18@
7954d0aecf6874027fb138a45485b3a9701db334
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
peter klausler [Wed, 3 Jul 2019 22:59:23 +0000 (15:59 -0700)]
[flang] Crash less
Original-commit: flang-compiler/f18@
e8ac1a697d7682bdcd7c5e1dc75d2445b92333bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
peter klausler [Wed, 3 Jul 2019 22:16:36 +0000 (15:16 -0700)]
[flang] Avoid null pointer dereference
Original-commit: flang-compiler/f18@
3c108c0edcdbf67e75039ddcefba74598905e87c
Reviewed-on: https://github.com/flang-compiler/f18/pull/553
Tree-same-pre-rewrite: false
Tim Keith [Wed, 3 Jul 2019 22:54:27 +0000 (15:54 -0700)]
[flang] Merge pull request flang-compiler/f18#550 from flang-compiler/tsk-bug
Prevent segfault in DynamicType::IsTkCompatibleWith
Original-commit: flang-compiler/f18@
8ff0df020b09b1df135f5c0bb4bb68ae93a6f992
Reviewed-on: https://github.com/flang-compiler/f18/pull/550
Tim Keith [Wed, 3 Jul 2019 22:47:37 +0000 (15:47 -0700)]
[flang] Prevent segfault in DynamicType::IsTkCompatibleWith
Make sure `derived_` is not null before dereferencing it.
This might only happen when there is a previous error. I saw it
compiling a test program where a USEd module was not found.
Original-commit: flang-compiler/f18@
2db516556b1509a8519ce91013f49431b6d43d22
Reviewed-on: https://github.com/flang-compiler/f18/pull/550
psteinfeld [Wed, 3 Jul 2019 21:28:49 +0000 (14:28 -0700)]
[flang] Merge pull request flang-compiler/f18#542 from flang-compiler/ps-c1128
Enforce constraint C1128 for DO CONCURRENT locality-spec's
Original-commit: flang-compiler/f18@
248600031d8fc500edc3e97e8921a0bad64681de
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
Peter Steinfeld [Wed, 3 Jul 2019 20:49:12 +0000 (13:49 -0700)]
[flang] Improved the implementation of "IsCoarray()" suggested by @tskeith.
Original-commit: flang-compiler/f18@
efaf5fca2e5acabd052eb6e4962aa92ce29aa2d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
Peter Steinfeld [Wed, 3 Jul 2019 03:34:27 +0000 (20:34 -0700)]
[flang] Changes in response to comments on pull request flang-compiler/f18#542.
Original-commit: flang-compiler/f18@
e156f977d856842bd8fe13d46133e5445404ee4d
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
Tree-same-pre-rewrite: false
Peter Steinfeld [Tue, 2 Jul 2019 19:10:09 +0000 (12:10 -0700)]
[flang] Enforce constraint C1128 for DO CONCURRENT locality-spec's
These changes implement most of the requirements for C1128, which says: "A
variable-name that appears in a LOCAL or LOCAL_INIT locality-spec shall not
have the ALLOCATABLE; INTENT (IN); or OPTIONAL attribute; shall not be of
finalizable type; shall not be a nonpointer polymorphic dummy argument; and
shall not be a coarray or an assumed-size array. A variable-name that is not
permitted to appear in a variable definition context shall not appear in a
LOCAL or LOCAL_INIT locality-spec."
The changes do not implement the checking required to determine whether a
variable can appear in a "variable definition context".
Here's a summary of the changes:
- I created the function 'PassesLocalityChecks()' to enforce C1128 along with
C1124, C1125, and C1126.
- I cleaned up the code to check if a type or symbol is a coarray.
- I added functions to tools.[h,cc] to test if a symbol is OPTIONAL, INTENT
IN, finalizable, a coarray, or an assumed size array. Should these be
member functions of the type "Symbol"?
- Since I changed one of the locality related error messages, I needed to
change the test resolve35.f90.
- I added the test resolve55.f90 to test all of the checks implemented in this
update.
Original-commit: flang-compiler/f18@
4ca5d090b9f9a82dd06cf46028586b1c7474f845
Reviewed-on: https://github.com/flang-compiler/f18/pull/542
Tree-same-pre-rewrite: false
Jinxin (Brian) Yang [Wed, 3 Jul 2019 21:24:37 +0000 (14:24 -0700)]
[flang] 2.7.1 DO: Checks about clause arguments that allow Int Expr (flang-compiler/f18#540)
All the IntExpr argument checks are done through evaluating the result of GetIntValue. If the argument is non-constant integer expr, Expression Analysis will be the gatekeeper.
Original-commit: flang-compiler/f18@
d8c4804828c1f9f68088940a50c1380a18a72987
Reviewed-on: https://github.com/flang-compiler/f18/pull/540
Peter Klausler [Wed, 3 Jul 2019 21:22:14 +0000 (14:22 -0700)]
[flang] Merge pull request flang-compiler/f18#548 from flang-compiler/pmk-fixes
Fix FINDLOC for Character data
Original-commit: flang-compiler/f18@
74a5c2a529b43c72f69e774cbd4959f153d68c98
Reviewed-on: https://github.com/flang-compiler/f18/pull/548
peter klausler [Wed, 3 Jul 2019 20:04:56 +0000 (13:04 -0700)]
[flang] Quick additional fix for crashes on statement functions without arguments
Original-commit: flang-compiler/f18@
79779967a97948ce44e29c0475cb78af9c2f80c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/548
peter klausler [Wed, 3 Jul 2019 19:19:35 +0000 (12:19 -0700)]
[flang] Trim duplicate error messages on intrinsics, and fix FINDLOC for Character data.
Original-commit: flang-compiler/f18@
48ab22e2130994653c5585cb290512543a3f599f
Reviewed-on: https://github.com/flang-compiler/f18/pull/548
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 3 Jul 2019 19:04:16 +0000 (12:04 -0700)]
[flang] Merge pull request flang-compiler/f18#545 from flang-compiler/pmk-more-fixes
Fix some crashes
Original-commit: flang-compiler/f18@
dcf5990e85f1f39cead11ac0a25e7ff074593491
Reviewed-on: https://github.com/flang-compiler/f18/pull/545
peter klausler [Wed, 3 Jul 2019 17:25:43 +0000 (10:25 -0700)]
[flang] Graceful handling of failure in LEN() (fixes crashes)
Original-commit: flang-compiler/f18@
8bab36574dd9b926f1e425559c69ba2b07fb8308
Reviewed-on: https://github.com/flang-compiler/f18/pull/545
peter klausler [Tue, 2 Jul 2019 20:47:02 +0000 (13:47 -0700)]
[flang] Avoid CHECK in error recovery situation with bad array bound
Original-commit: flang-compiler/f18@
d522c0da214444dc92df223c8ad028cda7579d84
Reviewed-on: https://github.com/flang-compiler/f18/pull/545
Tree-same-pre-rewrite: false
vdonaldson [Wed, 3 Jul 2019 16:59:59 +0000 (09:59 -0700)]
[flang] A minimal PRINT Enter function requires a minimal PRINT Leave function. (flang-compiler/f18#543)
Fixes flang-compiler/f18#541
Original-commit: flang-compiler/f18@
8f3c5481e15409b24fcf04c7b0e66f96e069bb4d
Reviewed-on: https://github.com/flang-compiler/f18/pull/543
Tim Keith [Tue, 2 Jul 2019 21:00:44 +0000 (14:00 -0700)]
[flang] Merge pull request flang-compiler/f18#539 from flang-compiler/tsk1
Check that procedures of a generic are distinguishable
Original-commit: flang-compiler/f18@
a24701e313019dbf84179b79e234f92d61de0fa6
Reviewed-on: https://github.com/flang-compiler/f18/pull/539
Due to a conflicting rebase during the linearizing of flang-compiler/f18, this commit squashes a number of other commits:
flang-compiler/f18@
9b1343af36bd27b110f31dab39c3a18a657a5760 Some cleanup in characteristics.{h,cc}
flang-compiler/f18@
ddb70e53d2b4e2bba12686e4ac3c26052758fcc3 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@
d1eef9506610a427f992180f6b59cafe09abb9b9 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@
24a6d3ffbf4d26d92222b27faa155bb5b3f517f4 Make test_folding.sh stricter in test for warnings
flang-compiler/f18@
c2c5b640604acceb45823de8cb5716d6921da7d4 Replace SymbolList with SymbolVector
flang-compiler/f18@
c8499584dff12381c2ce6d4718761cd225b4d97a Add CopyAttrs to copy attributes from Symbol
flang-compiler/f18@
0573ffd8b2ed5757e06a4fc6d5ffc4401e800c32 Replace cascading detailsIf calls with std::visit
flang-compiler/f18@
28ec62b3ffeec1d25fde330069b050655bb52a5d Add name to characteristics::DummyArgument
flang-compiler/f18@
568eaf01145d4ee979423d06f2a65d07222f6841 Add name to CopySymbol()
flang-compiler/f18@
8c557b09e752da205cd300f63b5ca69806fb2e78 Check that procedures of a generic are distinguishable
flang-compiler/f18@
50515fd987fd5479567e1b497f6ba93974ffde76 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
flang-compiler/f18@
a7963e98a4aedc97784b99903d04cdc48fd4c346 Address review comments
flang-compiler/f18@
edd65b3962dbaa1121c166d47c90730e39c25a04 Merge branch 'master' of github.com:flang-compiler/f18 into tsk1
Peter Klausler [Tue, 2 Jul 2019 17:01:46 +0000 (10:01 -0700)]
[flang] Merge pull request flang-compiler/f18#538 from flang-compiler/pmk-fixes
Semantics for LOC() & %LOC()
Original-commit: flang-compiler/f18@
770ed618052705b358aeffbaad7ae75a335ba84f
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
peter klausler [Tue, 2 Jul 2019 16:16:08 +0000 (09:16 -0700)]
[flang] Use enums instead of magic int values
Original-commit: flang-compiler/f18@
238f84c2fbe65ac03efc748cf31f6f96b6fc4561
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
peter klausler [Mon, 1 Jul 2019 23:54:53 +0000 (16:54 -0700)]
[flang] Use LOC() in iso_c_binding for C_LOC and C_FUNLOC
Original-commit: flang-compiler/f18@
da02305d1baed2e4862568e00810495e7d5dd65b
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Jul 2019 20:54:34 +0000 (13:54 -0700)]
[flang] clean up for review
Original-commit: flang-compiler/f18@
9bf94ea39c33be8136ee0c0dd832e382bcd76907
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
peter klausler [Mon, 1 Jul 2019 20:22:22 +0000 (13:22 -0700)]
[flang] Add LOC()/%LOC() intrinsics
Original-commit: flang-compiler/f18@
3a6b90c9f5c1a21a40323e56e2c26f6161d2f79c
Reviewed-on: https://github.com/flang-compiler/f18/pull/538
Tree-same-pre-rewrite: false
Jinxin (Brian) Yang [Mon, 1 Jul 2019 20:55:06 +0000 (13:55 -0700)]
[flang] Structural checks for DO construct (flang-compiler/f18#536)
Most restrictions in 2.7.1 Loop construct, nesting checks are still on TODO list.
seenClauses (EnumSet) is dropped. A multimap clauseInfo is added to save the encountering clause and its parser tree node pointer (parser::OmpClause) and to do the checks after walking through all the clauses.
Original-commit: flang-compiler/f18@
f79735768265ace3dcd2a5e1f7fbe4d770c379f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/536
Eric Schweitz [Mon, 1 Jul 2019 16:35:03 +0000 (09:35 -0700)]
[flang] Merge pull request flang-compiler/f18#537 from schweitzpgi/master
Fix a typo in Extract_Value description.
Original-commit: flang-compiler/f18@
b0b88d905c274b9d9553e59dd68666dda74f30f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/537
Eric Schweitz [Mon, 1 Jul 2019 16:10:49 +0000 (09:10 -0700)]
[flang] Fix a typo in Extract_Value description.
Original-commit: flang-compiler/f18@
873a6678da233108621824fc9d354eb27cbe7982
Reviewed-on: https://github.com/flang-compiler/f18/pull/537
Peter Klausler [Fri, 28 Jun 2019 21:02:44 +0000 (14:02 -0700)]
[flang] Merge pull request flang-compiler/f18#535 from flang-compiler/pmk-no-nchar
Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith
Original-commit: flang-compiler/f18@
62b19842bc2352917baf71443604357e78a99b9f
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
peter klausler [Fri, 28 Jun 2019 18:43:57 +0000 (11:43 -0700)]
[flang] One more
Original-commit: flang-compiler/f18@
8d73b44eae3dabdc68d8df5a4a97a8808ec7db25
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
peter klausler [Fri, 28 Jun 2019 18:34:15 +0000 (11:34 -0700)]
[flang] Missed one
Original-commit: flang-compiler/f18@
e84f4b9c7a5e76c2403539ee210cca1b98873605
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false
peter klausler [Fri, 28 Jun 2019 18:16:37 +0000 (11:16 -0700)]
[flang] Extirpate NCHARACTER type, NC"" literals, and EUC-JP Hollerith
Original-commit: flang-compiler/f18@
10a592a591c8e4f66f32e586597c19dd343914b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/535
Tree-same-pre-rewrite: false
Peter Klausler [Fri, 28 Jun 2019 17:36:47 +0000 (10:36 -0700)]
[flang] Merge pull request flang-compiler/f18#531 from flang-compiler/pmk-more-fixes
Roll up more minor features & fixes to semantics for bugs found by regression testing
Original-commit: flang-compiler/f18@
96a7932dab8247099d20e5e46bf9377666e424bd
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
peter klausler [Fri, 28 Jun 2019 00:16:29 +0000 (17:16 -0700)]
[flang] Better error reporting, with test
Original-commit: flang-compiler/f18@
85e8b64d3e86c3b8670790687ff1ea7f0857e41e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
peter klausler [Thu, 27 Jun 2019 22:58:23 +0000 (15:58 -0700)]
[flang] Formatting fix
Original-commit: flang-compiler/f18@
e158e4f1c6ddf5f51d9637725bce2873d75fb25c
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Thu, 27 Jun 2019 22:58:04 +0000 (15:58 -0700)]
[flang] Work around GCC 7.2.0 build issue
Original-commit: flang-compiler/f18@
c68349f78fb5228c7c78e30da29de87fdbe43fb8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Thu, 27 Jun 2019 16:57:48 +0000 (09:57 -0700)]
[flang] address review comments
Original-commit: flang-compiler/f18@
f7188a7a3331cce41d3887529b5864a9aab3b190
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Wed, 26 Jun 2019 23:34:41 +0000 (16:34 -0700)]
[flang] delete two obsolete tests that somehow got committed
Original-commit: flang-compiler/f18@
8b6a49416ce5557863035fd3eddfb27bb8b0e6e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Wed, 26 Jun 2019 22:30:53 +0000 (15:30 -0700)]
[flang] Fix regressions from testing pass
Original-commit: flang-compiler/f18@
70ea3b4b09c25be45a41326c78d412dd5eb69d43
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Wed, 26 Jun 2019 21:51:58 +0000 (14:51 -0700)]
[flang] Refine implicit typing of functions and prevent invalid conversion to objects
Original-commit: flang-compiler/f18@
a90f752c2075586f405803ea02877781890d3bde
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Tue, 25 Jun 2019 23:21:47 +0000 (16:21 -0700)]
[flang] Fix bad visitor type
Original-commit: flang-compiler/f18@
968b24c033f625713ee0f8297284a5eaec4cc32e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Tue, 25 Jun 2019 23:02:36 +0000 (16:02 -0700)]
[flang] Fix regression in constant array sections
Original-commit: flang-compiler/f18@
595be8defae9f6dd52811a21f33c4475c65aaed8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Tue, 25 Jun 2019 22:16:21 +0000 (15:16 -0700)]
[flang] Make unparsing of typed Exprs conditional when unparsing to pgf90
Original-commit: flang-compiler/f18@
3b79c290cd4cb5299b931d4b6e051cb677cffab4
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Tue, 25 Jun 2019 21:46:02 +0000 (14:46 -0700)]
[flang] Fix function call implicit typing after recent merge
Original-commit: flang-compiler/f18@
f91779c79a7224da0cc547b33afed19ddfb786f8
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Tue, 25 Jun 2019 20:07:32 +0000 (13:07 -0700)]
[flang] Refactor SymbolOrComponent typedef to NamedEntity class
Original-commit: flang-compiler/f18@
e8ec4b88bd6084beeae6a0d3037e019bc1d24c6b
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Mon, 24 Jun 2019 17:25:37 +0000 (10:25 -0700)]
[flang] work around bad module file output for visibility attrs on subprograms
Original-commit: flang-compiler/f18@
0970cccc4e05f62d2560f2c0f618839734422c82
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 23:13:56 +0000 (16:13 -0700)]
[flang] Better initialization support
Original-commit: flang-compiler/f18@
ff2f26fe7b708b4ff63a358c079b103a8682dcd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 23:13:34 +0000 (16:13 -0700)]
[flang] Support lower bounds in constants
Original-commit: flang-compiler/f18@
d5269cd5a2742887788736093c148d8866f7a93e
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:11:35 +0000 (14:11 -0700)]
[flang] Back out bad commit of f18 module files
Original-commit: flang-compiler/f18@
230117c4376661b3ea44227a4f279dd66eeda894
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:10:42 +0000 (14:10 -0700)]
[flang] Add LOGICAL8, &c.
Original-commit: flang-compiler/f18@
fd8df8cd8f7503310103bd1d99efea92a41dc053
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:10:19 +0000 (14:10 -0700)]
[flang] GetBaseObject()
Original-commit: flang-compiler/f18@
38eced54de5c5c801004748aeaffe116eb1834e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:09:51 +0000 (14:09 -0700)]
[flang] IsInitialDataTarget()
Original-commit: flang-compiler/f18@
c005e14de930b0ca19bb53a61c9a535c5b1abf1a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:08:52 +0000 (14:08 -0700)]
[flang] More extension names
Original-commit: flang-compiler/f18@
f30d4cf73d29d910c13911be7be958ac7a026945
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:08:07 +0000 (14:08 -0700)]
[flang] Fix pointer initializer
Original-commit: flang-compiler/f18@
4b2af83a75ab86c570fa8732dd705a8400fce30a
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:07:39 +0000 (14:07 -0700)]
[flang] Support anonymous parent components in struct const
Original-commit: flang-compiler/f18@
b28b9932b7704de8e112b6b5ddf76611b2f075f6
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:06:17 +0000 (14:06 -0700)]
[flang] Pass PGF90 options on only if underlying compiler is PGF90
Original-commit: flang-compiler/f18@
dc34f75b07cf96bd48d4c6116f9a55b47b5b1079
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:05:29 +0000 (14:05 -0700)]
[flang] Remove unused PRIVATE name
Original-commit: flang-compiler/f18@
829b8ca873c7d372e6e1cf6315249d4a010bdee1
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
peter klausler [Fri, 21 Jun 2019 21:04:40 +0000 (14:04 -0700)]
[flang] Add DOUBLE COMPLEX intrinsics & ASSOCIATED
Original-commit: flang-compiler/f18@
fbcc2c0b5daf10010e2917c27e4ac5be1d470a12
Reviewed-on: https://github.com/flang-compiler/f18/pull/531
Tree-same-pre-rewrite: false
psteinfeld [Thu, 27 Jun 2019 22:21:39 +0000 (15:21 -0700)]
[flang] Merge pull request flang-compiler/f18#533 from flang-compiler/ps-c1124
Fixes for DO constraint C1124
Original-commit: flang-compiler/f18@
00d74be74c7a822f53abe21e2bac89075af325de
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Peter Steinfeld [Thu, 27 Jun 2019 22:18:36 +0000 (15:18 -0700)]
[flang] Fixed the formatting of an "if" statement.
Original-commit: flang-compiler/f18@
0cf71144529e9ebd625acc9a64b9318c890b669d
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Peter Steinfeld [Thu, 27 Jun 2019 19:33:36 +0000 (12:33 -0700)]
[flang] Fixes for DO constraint C1124
The constraint says that a variable-name in a locality-spec shall be the name
of a variable in the innermost executable construct or scoping unit that
includes the DO CONCURRENT statement. This check was already being made in
resolve-names.cc for LOCAL and LOCAL_INIT locality specs but not for the
SHARED locality spec. Also, there was some code in check-do.cc that was
intended to be used to enforce this constraint at some time in the future.
I added code to resolve-names.cc to extend the checking to the SHARED locality
spec and removed the unused code from check-do.cc. I also extended the
existing tests in resolve35.f90 to exercise the new code.
Original-commit: flang-compiler/f18@
b421923d9403c3efe320e5ec2b722b88d1fdbd73
Reviewed-on: https://github.com/flang-compiler/f18/pull/533
Tree-same-pre-rewrite: false
Peter Klausler [Thu, 27 Jun 2019 16:56:58 +0000 (09:56 -0700)]
[flang] Merge pull request flang-compiler/f18#532 from peterwaller-arm/fix-gcc-7-build
Revert "Remove needless braces"
Original-commit: flang-compiler/f18@
c1c0a64582729e9ae1b5a8bb7ca26becdd522eac
Reviewed-on: https://github.com/flang-compiler/f18/pull/532
Peter Waller [Wed, 26 Jun 2019 09:44:08 +0000 (09:44 +0000)]
[flang] Revert "Remove needless braces"
This reverts commit
edd18355be574122aaa9abf58c15d8c50fb085a1.
Original-commit: flang-compiler/f18@
e5d164fd112d4f0585d2bbbf5c3d455f688c27e1
Reviewed-on: https://github.com/flang-compiler/f18/pull/532
vdonaldson [Wed, 26 Jun 2019 22:50:10 +0000 (15:50 -0700)]
[flang] Remove unnecessary semicolons to avoid gcc warnings. (flang-compiler/f18#529)
Original-commit: flang-compiler/f18@
bdba83625417157c6f29605ade74ecbdb6ebff2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/529
vdonaldson [Wed, 26 Jun 2019 22:46:48 +0000 (15:46 -0700)]
[flang] Initialize PRINT semantics. Fixes flang-compiler/f18#516 (flang-compiler/f18#528)
There are no Clause 12 constraints to check for PRINT, but PRINT does share
FMT specifier processing with READ and WRITE. To avoid interactions between
these I/O statements, reset IoChecker values for PRINT.
Original-commit: flang-compiler/f18@
6a547667187e2832c8c162d4ee02835ff4c190b4
Reviewed-on: https://github.com/flang-compiler/f18/pull/528
Steve Scalpone [Wed, 26 Jun 2019 22:46:04 +0000 (15:46 -0700)]
[flang] Merge pull request flang-compiler/f18#526 from flang-compiler/sjs-build-predef-modfiles
Compile and install the predefined module files.
Original-commit: flang-compiler/f18@
c9b23dc706d6e75a2cb63215cfc72f68d842ddf6
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
Steve Scalpone [Tue, 25 Jun 2019 16:57:38 +0000 (09:57 -0700)]
[flang] Compile and install the predefined module files.
Change the CMakeFile.txt in tools/f18 to build the predefined modules with the just-built compiler. The mod files are created in the new "include" subdirectory of the binary target directory. The mod files are installed to ${CMAKE_INSTALL_PREFIX}/include.
The f18 driver is already installed in ${CMAKE_INSTALL_PREFIX}/bin. This change change the location of the f18 binary build to a sibling directory of "include" called "bin" instead of at the top level of the binary destination directory. This change is in anticipation of changing the driver to find the include directory using a path relative to the location of f18.
Update the test scripts to find f18 in the bin subdirectory.
Remove the simple predefined module tests from test/semantics because they are compiled as part of the build and don't need to be recompiled as part of a test.
Original-commit: flang-compiler/f18@
7811ccecdc065e7e6eb004c8eaefc245f642aea3
Reviewed-on: https://github.com/flang-compiler/f18/pull/526
Jinxin (Brian) Yang [Tue, 25 Jun 2019 23:18:51 +0000 (16:18 -0700)]
[flang] OpenMP structural check framework (PARALLEL as example) (flang-compiler/f18#493)
This patch is to show the framework to do OpenMP structure related check and you may find missing/incomplete implementation, which will be added in the future.
1. Each encountering construct has its own context and the context info will be filled while walking the directive/clause nodes. In the `Leave`, the current OpenMP context will be popped out.
2. When entering the construct, necessary nesting check will be performed. Use std::vector to implement the context stack because certain nesting restrictions may need to trace back more than one level.
3. PARALLEL construct is used as an example for clause validity check.
4. `EnumSet` is used to represent the directive/clause sets and to show the error msg. All the error msgs are quoted from the specification.
5. Necessary `CharBlock` is added for error msgs.
Original-commit: flang-compiler/f18@
620441c03e21ae28aed3864b9581cd6cc1705c65
Reviewed-on: https://github.com/flang-compiler/f18/pull/493
vdonaldson [Tue, 25 Jun 2019 22:59:30 +0000 (15:59 -0700)]
[flang] Clause 13 (Input/output editing) syntax and semantic checking (flang-compiler/f18#498)
* Clause 13 (Input/output editing) syntax and semantic checking
Diagnose:
- all clause syntax errors (independent of normal parsing)
- all clause constraints
- use of non-standard extensions under -Mstandard
- obvious program requirement violations
The code:
- is invoked for both format statement and I/O statement constant formats
- should be useable by the runtime I/O library for runtime formats
- is able to recover from errors
- is able to diagnose multiple errors in a single format
- has accurate markers for errors
- can process (fixed character size) Hollerith strings
- generates reasonable error messages for known error scenarios
- should not require C++ run-time library support
The code is templatized for use with fixed size character kind={1,2,4} input,
but only the kind=1 variant is actually exercised.
* Review update.
* Review update.
* Review update.
* Improve error processing of unterminated formats.
Original-commit: flang-compiler/f18@
c04b7518df75bb516f039065d4edcba87dae8210
Reviewed-on: https://github.com/flang-compiler/f18/pull/498
Tim Keith [Tue, 25 Jun 2019 21:41:53 +0000 (14:41 -0700)]
[flang] Merge pull request flang-compiler/f18#521 from flang-compiler/tsk2
Check constraints on passed-object dummy argument
Original-commit: flang-compiler/f18@
d1d9f6eb78f1776e04d2bcd9027efac9170bde01
Reviewed-on: https://github.com/flang-compiler/f18/pull/521
Tim Keith [Sun, 23 Jun 2019 17:59:32 +0000 (10:59 -0700)]
[flang] Check constraints on passed-object dummy argument
The passed-object dummy argument cannot be checked until the
interfaces of contained subprograms are known. To accomplish this,
add `FinishSpecificationPart` pass to run after all specification
parts have been analyzed but before any of the execution parts.
This visits all derived types defined in each scope and performs
the checks on each procedure component and procedure binding.
Add a flag to `ParamValue` to distinguish kind from len parameters.
Fix some tests that had errors we now detect.
Original-commit: flang-compiler/f18@
4789643c5bdbda8206cc1873bc56735b11953227
Reviewed-on: https://github.com/flang-compiler/f18/pull/521