Tim Keith [Mon, 24 Jun 2019 23:34:28 +0000 (16:34 -0700)]
[flang] Merge pull request flang-compiler/f18#524 from flang-compiler/tsk1
Fix internal error due to missing type
Original-commit: flang-compiler/f18@
72f88d17298956e0470f0a4797b5bee43fa84ea7
Reviewed-on: https://github.com/flang-compiler/f18/pull/524
Tim Keith [Mon, 24 Jun 2019 22:22:57 +0000 (15:22 -0700)]
[flang] Fix internal error due to missing type
If a name is declared in a module with just `private :: x`,
we don't know if `x` is supposed to be an object or procedure,
so it ends up not getting an implicit type. This leads to an
internal error when writing the `.mod` file.
The fix requires two changes:
1. Cause all `EntityDetails` to be converted to `ObjectEntityDetails`
in `ResolveSpecificationParts`. This is done by calling `PopScope()`.
The reason for not calling it there no longer applies since the
addition of the `ExecutionPartSkimmer` pass.
2. In the same place, apply the implicit typing rules to every entity
in the scope.
Fixes flang-compiler/f18#514, fixes flang-compiler/f18#520.
Original-commit: flang-compiler/f18@
7e4185e9ff34dc02f6299aa16236f3b932b16652
Reviewed-on: https://github.com/flang-compiler/f18/pull/524
Eric Schweitz [Mon, 24 Jun 2019 20:18:27 +0000 (13:18 -0700)]
[flang] Merge pull request flang-compiler/f18#507 from schweitzpgi/master
Add the FIR dialect of MLIR document
Original-commit: flang-compiler/f18@
49d09f84edd5f3c371888c0a9dcf5433a63364c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
Eric Schweitz [Thu, 20 Jun 2019 00:37:33 +0000 (17:37 -0700)]
[flang] address review comments
add words on what is meant by meta information
Original-commit: flang-compiler/f18@
ee2f3acf3c6ebaa27d8ebb57193ebcb7b8d0130a
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
Eric Schweitz [Wed, 19 Jun 2019 21:11:32 +0000 (14:11 -0700)]
[flang] Add the FIR dialect of MLIR document
Original-commit: flang-compiler/f18@
10ab8b42b3ca76bdae4d5a77884ab58b64af8645
Reviewed-on: https://github.com/flang-compiler/f18/pull/507
Tree-same-pre-rewrite: false
Tim Keith [Mon, 24 Jun 2019 20:08:24 +0000 (13:08 -0700)]
[flang] Merge pull request flang-compiler/f18#523 from flang-compiler/tsk0
Fix bug in writing PRIVATE subprograms to .mod file
Original-commit: flang-compiler/f18@
ad443e243902acb048f728768492cfbdf9034025
Reviewed-on: https://github.com/flang-compiler/f18/pull/523
Tim Keith [Mon, 24 Jun 2019 19:35:17 +0000 (12:35 -0700)]
[flang] Fix bug in writing PRIVATE subprograms to .mod file
Subprograms can't have the PRIVATE prefix on them when they are defined.
So if they are private, add a private-stmt for them.
Fixes flang-compiler/f18#519
Original-commit: flang-compiler/f18@
d3670aa176cbc79a7d26fc927e9d1e1349900756
Reviewed-on: https://github.com/flang-compiler/f18/pull/523
Steve Scalpone [Mon, 24 Jun 2019 16:58:11 +0000 (09:58 -0700)]
[flang] Merge pull request flang-compiler/f18#522 from flang-compiler/sjs-predef-mod-test
Add a set of tests which compile the predefined module files.
Original-commit: flang-compiler/f18@
e50fb71914c4e2c3915da7dfa7b1cdfccea1f03f
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
Steve Scalpone [Mon, 24 Jun 2019 00:14:19 +0000 (17:14 -0700)]
[flang] Port to macOS, where mktemp doesn't have -p.
Original-commit: flang-compiler/f18@
bd698aee686b2698691d4184daa2d1e28e401c97
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
Steve Scalpone [Sun, 23 Jun 2019 20:30:23 +0000 (13:30 -0700)]
[flang] Add a set of tests which compile the predefined module files. Each test simply tries to compile the module source file. Modify the script test_errors.sh to work with a source file that is specified as a full path. Also, change how the test temp directory is created to use a random name in case any of the source file base names are duplicated.
Original-commit: flang-compiler/f18@
ec048ab1d528cf6ebc1d45767544201064b8fbe8
Reviewed-on: https://github.com/flang-compiler/f18/pull/522
Tree-same-pre-rewrite: false
psteinfeld [Fri, 21 Jun 2019 03:07:58 +0000 (20:07 -0700)]
[flang] Merge pull request flang-compiler/f18#510 from flang-compiler/ps-do-msg
Changes to improve messages for DO semantics
Original-commit: flang-compiler/f18@
b89993ac7d6a1b2136fdb15bf79fb363376ea8a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/510
Peter Steinfeld [Fri, 21 Jun 2019 00:02:32 +0000 (17:02 -0700)]
[flang] Changes to improve messages for DO semantics
I changed two things in the messages produced for DO semantic checks --
- I changed the source location to be specific to where conflicting names are
declared.
- I added the conflicting names to the message.
Original-commit: flang-compiler/f18@
f39f9ceeae3a6471eae2a4e651d39a0921416b1b
Reviewed-on: https://github.com/flang-compiler/f18/pull/510
Tim Keith [Thu, 20 Jun 2019 23:13:38 +0000 (16:13 -0700)]
[flang] Merge pull request flang-compiler/f18#509 from flang-compiler/tsk1
Fix CHECK failure on undeclared type parameter
Original-commit: flang-compiler/f18@
de95ab7ebe5524536fd7430b01916f67dd8b9788
Reviewed-on: https://github.com/flang-compiler/f18/pull/509
Tim Keith [Thu, 20 Jun 2019 21:23:21 +0000 (14:23 -0700)]
[flang] Fix CHECK failure on undeclared type parameter
In the example below, the compiler gets an internal error when
processing the derived-type-spec for the declaration of `x`.
When the search for type parameter `k` fails it means an error
has already occurred and we should skip that parameter.
```
type :: t(k)
end type
type(t):: x
end
```
Original-commit: flang-compiler/f18@
a4bf1922e5f2e4bc4d16a940bbb2367e171eb271
Reviewed-on: https://github.com/flang-compiler/f18/pull/509
psteinfeld [Thu, 20 Jun 2019 19:45:27 +0000 (12:45 -0700)]
[flang] Merge pull request flang-compiler/f18#504 from flang-compiler/ps-c1123
Expressions in a DO CONCURRENT header should not reference names declared in the header
Original-commit: flang-compiler/f18@
8587141832ac60b5d54a01d776a6d61eacd6735f
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Peter Steinfeld [Thu, 20 Jun 2019 18:45:17 +0000 (11:45 -0700)]
[flang] Added "const" to a few declarations in response to review comments.
Original-commit: flang-compiler/f18@
f93045c5237adaea10f597b44a93d6c7b8e4c179
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Peter Steinfeld [Thu, 20 Jun 2019 16:56:59 +0000 (09:56 -0700)]
[flang] These changes are in response to comments on my pull request for C1123.
Here's a summary of the changes:
- I renamed a function to ResolveControlExpressions for clarity.
- I changed the interface to the function to ResolveIndexName for clarity.
- I simplified the code for walking the "step" and scalar mask expressions in
a DO CONCURRENT control statements to not check for the presence of optional
expressions.
- I added "const" to the declaration of a local variable.
- I removed some spurious comments from the test dosemantics04.f90.
- I added two new tests to dosemantics04.f90 to verify cases that were not
covered in my original test implementation.
Original-commit: flang-compiler/f18@
fa5827061a4cfdf6a0f8db389202d7657dffdddd
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Tree-same-pre-rewrite: false
Peter Steinfeld [Tue, 18 Jun 2019 22:46:51 +0000 (15:46 -0700)]
[flang] I fixed a problem in C1123. This constraint requires that expressions in a DO
CONCURRENT header not reference names declared in the same header. To
implement this, I changed the "Pre" function for ConcurrentHeader to walk the
subtree in an order that caused the variables associated with the declared
names to be created before any of the expressions were walked.
I added the test dosemantics04.f90 to test this.
Original-commit: flang-compiler/f18@
9f3b55241407649fc848d83c9415fd7d91e3056b
Reviewed-on: https://github.com/flang-compiler/f18/pull/504
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 19 Jun 2019 23:56:31 +0000 (16:56 -0700)]
[flang] Merge pull request flang-compiler/f18#508 from flang-compiler/pmk-fixes
Fix a couple bugs with SELECT TYPE(p) from regression tests
Original-commit: flang-compiler/f18@
0b25c908da5ae194918cc16334338e485bf92946
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
peter klausler [Wed, 19 Jun 2019 23:44:36 +0000 (16:44 -0700)]
[flang] back out -Mstandard
Original-commit: flang-compiler/f18@
a040c4bdef1adf0f26be2628865c2b6c2d7a0fb9
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
peter klausler [Wed, 19 Jun 2019 23:34:22 +0000 (16:34 -0700)]
[flang] EQUIVALENCE numeric/character as extension with warning
Original-commit: flang-compiler/f18@
0182efb7596614451d581f42ae2683cf9ecd8d77
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
Tree-same-pre-rewrite: false
peter klausler [Wed, 19 Jun 2019 22:04:57 +0000 (15:04 -0700)]
[flang] Fix a couple bugs with SELECT TYPE(p) from regression tests
Original-commit: flang-compiler/f18@
7539a01ecd7b73650436b82faa2482b3432327b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/508
Tree-same-pre-rewrite: false
Tim Keith [Wed, 19 Jun 2019 22:01:14 +0000 (15:01 -0700)]
[flang] Merge pull request flang-compiler/f18#506 from flang-compiler/tsk2
Prevent .mod files from being left by tests
Original-commit: flang-compiler/f18@
7810c034c87027a6cdae2b679405c2d462229774
Reviewed-on: https://github.com/flang-compiler/f18/pull/506
Tim Keith [Wed, 19 Jun 2019 20:18:17 +0000 (13:18 -0700)]
[flang] Prevent .mod files from being left by tests
test_symbols.sh and test_folding.sh were running the compiler in the
test directory (e.g. `<build>/test/semantics`). This meant that .mod
files were being left there because they weren't cleaned up.
Change to run the compiler in the temp directory created for each test.
It is deleted at the end so files aren't left behind.
Original-commit: flang-compiler/f18@
4f9735ada7b142e7a013bede4a3d258b6620a573
Reviewed-on: https://github.com/flang-compiler/f18/pull/506
Peter Klausler [Wed, 19 Jun 2019 20:26:28 +0000 (13:26 -0700)]
[flang] Merge pull request flang-compiler/f18#505 from flang-compiler/pmk-not
Fix a couple things, support ALLOCATED
Original-commit: flang-compiler/f18@
175cc5f8f527f3a699fa5a27ee9e896eeb29d7f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
peter klausler [Wed, 19 Jun 2019 19:37:49 +0000 (12:37 -0700)]
[flang] Remove extra semicolon
Original-commit: flang-compiler/f18@
c94327b56b311de059d7cdcf26e59eaaec9117c4
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
peter klausler [Wed, 19 Jun 2019 18:50:07 +0000 (11:50 -0700)]
[flang] Fix source provenance of .NOT., add ALLOCATED intrinsic
Original-commit: flang-compiler/f18@
e7e0de9e0df189f803d609d123b54d3a65182890
Reviewed-on: https://github.com/flang-compiler/f18/pull/505
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 18 Jun 2019 23:22:31 +0000 (16:22 -0700)]
[flang] Merge pull request flang-compiler/f18#503 from flang-compiler/pmk-fixes
Fix flang-compiler/f18#499 and flang-compiler/f18#500, enable -fno-exceptions
Original-commit: flang-compiler/f18@
7cb2a0af5617f87f97aa5dee5c44616bb503856f
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
peter klausler [Tue, 18 Jun 2019 22:32:20 +0000 (15:32 -0700)]
[flang] Force -fexceptions for real arithmetic tests
Original-commit: flang-compiler/f18@
532dd3b6df55af2df334203b3e18e6d9310b821e
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
peter klausler [Tue, 18 Jun 2019 22:15:22 +0000 (15:15 -0700)]
[flang] Rearrange some move(get<>()) calls into get<>(move()) to dodge GCC possibly-uninit warnings (bogus)
Original-commit: flang-compiler/f18@
f369c6025c593f8a8b2426f2ce03c7ddec9a4ff9
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false
peter klausler [Tue, 18 Jun 2019 21:10:47 +0000 (14:10 -0700)]
[flang] -fno-exceptions
Original-commit: flang-compiler/f18@
81d09c2053671b438fdc64b4fe30b6263c6cc5b9
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 18 Jun 2019 21:01:11 +0000 (14:01 -0700)]
[flang] Merge pull request flang-compiler/f18#496 from flang-compiler/pmk-ascii
Support Latin-1 source encodings, generally clean up source character processing
Original-commit: flang-compiler/f18@
7a68cf07062c54d2ce8f7f6a15f2dec912b69247
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
peter klausler [Tue, 18 Jun 2019 20:46:54 +0000 (13:46 -0700)]
[flang] Review comments and last (?) bugs
Original-commit: flang-compiler/f18@
db8302e3ab0b837d968e82dc9ac7d6a329c784c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
peter klausler [Tue, 18 Jun 2019 19:34:23 +0000 (12:34 -0700)]
[flang] more fixes from tests
Original-commit: flang-compiler/f18@
bb8df72635beeea3b017ee476a009411a8c59f53
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Mon, 17 Jun 2019 23:12:28 +0000 (16:12 -0700)]
[flang] nag debugged
Original-commit: flang-compiler/f18@
ab91b7c19156156103b3111393882b4a709295eb
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Mon, 17 Jun 2019 19:29:20 +0000 (12:29 -0700)]
[flang] fixes
Original-commit: flang-compiler/f18@
f504e6a938012a9593b434aa63c4c7752a36f2cc
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Mon, 17 Jun 2019 17:35:34 +0000 (10:35 -0700)]
[flang] All fixed except for a few NAG differences
Original-commit: flang-compiler/f18@
8dea4fb7609f09e195e8d70d8351e81ca070d414
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Fri, 14 Jun 2019 22:44:32 +0000 (15:44 -0700)]
[flang] More debugging vs. regression tests
Original-commit: flang-compiler/f18@
d4fd4ad1eca91336cdd2fb1add93d97ecb303720
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Thu, 13 Jun 2019 21:16:04 +0000 (14:16 -0700)]
[flang] Fixes
Original-commit: flang-compiler/f18@
73edc5bf2ba0b342ec1f4e496faae0eeba6475c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Wed, 12 Jun 2019 22:26:37 +0000 (15:26 -0700)]
[flang] Character set and encoding changes
Original-commit: flang-compiler/f18@
a550cbd4c0f92a3f88ed230a3bd809dd77ca4b12
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
peter klausler [Tue, 11 Jun 2019 17:34:58 +0000 (10:34 -0700)]
[flang] Tests pass
Original-commit: flang-compiler/f18@
ae9d07a2ab3fa5c59480ed869a9cceacaf90f8af
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
Tim Keith [Mon, 17 Jun 2019 20:12:10 +0000 (13:12 -0700)]
[flang] Merge pull request flang-compiler/f18#502 from flang-compiler/tsk3
Handle nested interface blocks
Original-commit: flang-compiler/f18@
a3c6c70b990bd52bad4df4a3d3480c85a4e48780
Reviewed-on: https://github.com/flang-compiler/f18/pull/502
Tim Keith [Fri, 14 Jun 2019 22:04:13 +0000 (15:04 -0700)]
[flang] Handle nested interface blocks
Interface blocks can be nested if one of the interface bodies
declares a subprogram with a dummy procedure that is specified
by an interface block. See the addition to `modfile07.f90` for
and example.
This didn't work because there was only one copy of each of
`inInterfaceBlock_`, `isAbstract_`, and `genericSymbol_`.
We need these for each active interface block, so replace these
with a stack. A new entry is pushed on the stack when we enter
an `InterfaceStmt` or `GenericStmt` and popped when we leave.
Also in the same example, when declaring the dummy procedure, the
dummy argument is initially an `EntityDetails` but it is replaced
by a `SubprogramDetails` when it is specified by the interface.
Original-commit: flang-compiler/f18@
0c468b60b119e132d47803ec8e17b231474ac55c
Reviewed-on: https://github.com/flang-compiler/f18/pull/502
Jinxin (Brian) Yang [Fri, 14 Jun 2019 16:00:02 +0000 (09:00 -0700)]
[flang] Merge pull request flang-compiler/f18#501 from flang-compiler/by-mp-isdeviceptr
Add missing IS_DEVICE_PTR and LINK clauses for OpenMP parsing
Original-commit: flang-compiler/f18@
76947faa462b2e0e92404c3027eed6459e1fc867
Reviewed-on: https://github.com/flang-compiler/f18/pull/501
Jinxin Yang [Thu, 13 Jun 2019 22:33:15 +0000 (15:33 -0700)]
[flang] Add missing IS_DEVICE_PTR and LINK clauses for OpenMP parsing
Original-commit: flang-compiler/f18@
541d4031e0d8b79a2fb7e68797d7f64b54980d78
Reviewed-on: https://github.com/flang-compiler/f18/pull/501
Steve Scalpone [Thu, 13 Jun 2019 04:02:57 +0000 (21:02 -0700)]
[flang] Merge pull request flang-compiler/f18#497 from flang-compiler/sjs-no-rtti
Use -fno-rtti when compiling f18.
Original-commit: flang-compiler/f18@
391926949b637e9a35af13a98d7a0f6174365a0f
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
Steve Scalpone [Thu, 13 Jun 2019 04:01:26 +0000 (21:01 -0700)]
[flang] Remove extra spaces.
Original-commit: flang-compiler/f18@
777bf033b5240e4ebba7278ceff95973e4b4d3ce
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
Steve Scalpone [Thu, 13 Jun 2019 00:01:41 +0000 (17:01 -0700)]
[flang] Our coding conventions prohibit rtti; enforce with the -fno-rtti compilation flag.
Original-commit: flang-compiler/f18@
d2817cc9c23d7cfc4377222f30700b8077fc51d1
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
Tree-same-pre-rewrite: false
Tim Keith [Wed, 12 Jun 2019 21:49:32 +0000 (14:49 -0700)]
[flang] Merge pull request flang-compiler/f18#494 from flang-compiler/tsk4
Resolve and check names in equivalence sets
Original-commit: flang-compiler/f18@
b1cc835872035a761090cf900e41d64fdab8640b
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
Tim Keith [Wed, 12 Jun 2019 19:38:04 +0000 (12:38 -0700)]
[flang] Handle substring of array element in EQUIVALENCE
A substring of an array element is legal as an equivalence object,
e.g. `a(2,3)[4:5]`. Extend `EquivalenceObject` to include the start
of the substring, if any. Split `CheckBound` into `CheckArrayBound`
and `CheckSubstringBound`.
When evaluating bounds in `AddToSet` we can assert they are constant
because all of the error cases should have been detected already.
Original-commit: flang-compiler/f18@
0b4050b2d56e166458c5d9259234a1d404e467e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
Tim Keith [Wed, 12 Jun 2019 01:26:48 +0000 (18:26 -0700)]
[flang] Resolve and check names in equivalence sets
Collect sets of `parser::EquivalenceObject` to process at the end of
the specification part. This is so that names mentioned in the
EQUIVALENCE statement don't trigger implicit declarations.
The `EquivalenceSets` class performs most of the numerous checks
on objects that can be in equivalence sets at all and objects that
can be in them together. It also merges sets when the same object
appears in more than one.
Once equivalence sets are checked they are added to the `Scope`.
Further checks will be necessary after the size and alignment of
variables are computed.
Add `FindUltimateComponent` to simplify checks on ultimate components
of derived types. Use it to implement `HasCoarrayUltimateComponent`
and checks on equivalence objects.
Make `ExpressionAnalyzer::Analyze(Designator)` public so that
`parser::EquivalenceObject` can be analyzed.
Add `GetDefaultKind`, `doublePrecisionKind`, and `quadPrecisionKind`
to `SemanticsContext` so that `defaultKinds_` does not need to be
accessed directly.
Original-commit: flang-compiler/f18@
1cc898e5b8d5dbda19748d8bc2ee8cba5c7df4ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
Tree-same-pre-rewrite: false
Peter Klausler [Tue, 11 Jun 2019 20:03:58 +0000 (13:03 -0700)]
[flang] Merge pull request flang-compiler/f18#492 from flang-compiler/pmk-bug491
Fix bug flang-compiler/f18#491 (and replace a misleading name)
Original-commit: flang-compiler/f18@
41d0c067016f811caaca70f66cd9dfbfcee9cf2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
peter klausler [Tue, 11 Jun 2019 19:50:27 +0000 (12:50 -0700)]
[flang] Improve clarity per review comment
Original-commit: flang-compiler/f18@
7206c08f2ae2f8780f26b2ce4c616cff907b41c6
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
peter klausler [Tue, 11 Jun 2019 19:06:18 +0000 (12:06 -0700)]
[flang] Fix bug flang-compiler/f18#491 (and replace a misleading name)
Original-commit: flang-compiler/f18@
d0d154e31286afd08919e7011fb7fd7878aefdac
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
Tree-same-pre-rewrite: false
psteinfeld [Tue, 11 Jun 2019 14:15:40 +0000 (07:15 -0700)]
[flang] Merge pull request flang-compiler/f18#478 from flang-compiler/ps-issue458
Semantic checks for DO controls of type REAL
Original-commit: flang-compiler/f18@
b52469ecd113ddf28f4a3ea6d34d3b91f4ff579a
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Peter Steinfeld [Mon, 10 Jun 2019 22:10:32 +0000 (15:10 -0700)]
[flang] Fixed situations where multiple error messages were being emitted.
Original-commit: flang-compiler/f18@
ac62cfa9cd92e95e7b80f7aad66ceabb83ee3eda
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Peter Steinfeld [Mon, 10 Jun 2019 21:03:24 +0000 (14:03 -0700)]
[flang] Renamed check.*do.*stmt to check.*do to better conform with the grammar.
Original-commit: flang-compiler/f18@
d7419566e7e4b1d48914e2c5455031eb5fd0e54d
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Steinfeld [Mon, 10 Jun 2019 20:30:29 +0000 (13:30 -0700)]
[flang] These are additional changes for issue 458, to perform semantic checks on DO
variable and initial, final, and step expressions.
Here's a summary of the changes since my original pull request:
- I've taken into account the possibility that the DO variable is declared in
a MODULE. This required a call to GetUltimate() on the Symbol for the DO
variable.
- The previous change exposed problems in the semantic checking for NULLIFY
and DEALLOCATE statements, so I've included fixes and tests for those. I
also added a test for the ALLOCATE statement, even though it was already
handling this case.
- I now handle the case where a procedure name is erroneously used as a DO variable.
- I now handle the case where a pointer to a procedure is erroneously used as
a DO variable.
- I now check that the DO expressions are not null.
- I added tests for all cases listed above.
Original-commit: flang-compiler/f18@
219d856fdb6f36c152153085dbe73eda3442127c
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Steinfeld [Thu, 6 Jun 2019 21:05:02 +0000 (14:05 -0700)]
[flang] Changes in response to Peter's comments on a previous pull request.
Specifically, that the conversion of warnings to errors will happen in a
single place in the compiler once we implement warnings as distinct from
errors. This change made on of the tests invalid.
Also, there's no need to check whether the extension to allow
REAL DO controls is enabled.
Original-commit: flang-compiler/f18@
2fae9edd77b930cef8ececb16d719f16477ef3b0
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Steinfeld [Wed, 5 Jun 2019 21:34:25 +0000 (14:34 -0700)]
[flang] Added the machinery for REAL DO controls to be treated as a separate
extension.
Original-commit: flang-compiler/f18@
1907cf867277df34925bfab53f2060c303774ce3
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Steinfeld [Wed, 5 Jun 2019 18:57:09 +0000 (11:57 -0700)]
[flang] Changes responding to comments on my previous pull request. Specifically --
parse-tree.cc
- Cleaned up the use of "const" in several declarations.
check-do-stmt.cc
- Replaced uses of parser::Messages with SemanticsContext.
- Removed unused "==" operator from the DoStmtContext class.
- Reduced the size of the GetBounds function by calling GetLoopControl().
- Changed the warning message for REAL DO controls to not mention standard
extensions.
check-do-stmt.h
- Restored the forward reference to Fortran::parser::DoConstruct and removed
the include of parse-tree.h
dosemantics*.f90
- Removed extraneous references to the "RUN" command.
test_errors.sh
- Simplified and generalized the extraction of the OPTIONS specification.
Original-commit: flang-compiler/f18@
04a071276648e505f6f958739239e6f7f5870ff4
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Steinfeld [Tue, 4 Jun 2019 22:14:34 +0000 (15:14 -0700)]
[flang] These changes are for issue 458, to perform semantic checks on DO variable
and initial, final, and step expressions. As a new extension, we want to allow
REAL and DOUBLE PRECISION values for them by default.
Here's a summary of the changes:
- There already existed infrastructure for semantic checking of DO loops that
was partially specific to DO CONCURRENT loops. Because I re-used some of
this infrastructure, I renamed some files and classes from "concurrent" to
"stmt".
- I added some functions to distinguish among the different kinds of DO
statements.
- I added the functions to check-do-stmt.cc to produce the necessary warnins
and errors. Note that there are no tests for the warnings since the
necessary testing infrastructure does not yet exist.
- I changed test-errors.sh so that additional compilation options can be
specified in the test source.
- I added two new tests to test for the various kinds of values that can be
used for the DO variables and control expressions. The two tests are
identical except for the use of different compilation options.
dosemantics03.f90 specifies the options "-Mstandard -Werror" to produce
error messages for the use of REAL and DOUBLE PRECISION DO variables and
controls. dosemantics04.f90 uses the default options and only produces
error messages for contructs that are erroneous by default.
Original-commit: flang-compiler/f18@
f484660c75941b5af93bd8bc7aabe73ab958769c
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
Peter Klausler [Mon, 10 Jun 2019 16:26:29 +0000 (09:26 -0700)]
[flang] Merge pull request flang-compiler/f18#490 from flang-compiler/pmk-gcc-9.1.0
Dodge a GCC-specific valgrind warning
Original-commit: flang-compiler/f18@
2880605122f42339292410b34f1034b45a35a63e
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
peter klausler [Mon, 10 Jun 2019 16:26:02 +0000 (09:26 -0700)]
[flang] Remove temporary debugging code
Original-commit: flang-compiler/f18@
e7147ebfbe3629149d5afa751c5234d8f577f8db
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
peter klausler [Fri, 7 Jun 2019 23:00:46 +0000 (16:00 -0700)]
[flang] Dodge valgrind complaint by cleaning up the grammar a bit
Original-commit: flang-compiler/f18@
3f9f9af1e8794df628d537c494c8f260bb92c0ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
peter klausler [Fri, 7 Jun 2019 17:21:20 +0000 (10:21 -0700)]
[flang] some clean-up
Original-commit: flang-compiler/f18@
6134e1c2f28727990ca2441311e4fe8108559481
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
peter klausler [Tue, 7 May 2019 19:24:59 +0000 (12:24 -0700)]
[flang] Remove needless braces
Original-commit: flang-compiler/f18@
edd18355be574122aaa9abf58c15d8c50fb085a1
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
Eric Schweitz [Fri, 7 Jun 2019 20:40:50 +0000 (13:40 -0700)]
[flang] Merge pull request flang-compiler/f18#489 from schweitzpgi/chipper
Remove the FIR directory
Original-commit: flang-compiler/f18@
8ef23f0720be3070518de26c8f73c00d2bcf84e4
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Eric Schweitz [Fri, 7 Jun 2019 17:17:41 +0000 (10:17 -0700)]
[flang] remove FIR
Original-commit: flang-compiler/f18@
008ad16e289d5cb212396c3118095a0f5f87c6c9
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Eric Schweitz [Thu, 6 Jun 2019 17:53:38 +0000 (10:53 -0700)]
[flang] Remove the old FIR middle end from the f18 program and speed up build time.
Original-commit: flang-compiler/f18@
5b410b978c50cb367aa9f5e706afea4bd8e1d854
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
Eric Schweitz [Tue, 23 Apr 2019 21:40:04 +0000 (14:40 -0700)]
[flang] start splitting up afforestation so it isn't monolithic
Original-commit: flang-compiler/f18@
842a42d95450f1ddd2d20720c246b635de7d618c
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
Peter Klausler [Fri, 7 Jun 2019 20:32:15 +0000 (13:32 -0700)]
[flang] Merge pull request flang-compiler/f18#488 from flang-compiler/pmk-fixes
More fixes from test suite shakedown
Original-commit: flang-compiler/f18@
357b834676cef6795cc88240c6305aead55c6964
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
peter klausler [Fri, 7 Jun 2019 19:00:32 +0000 (12:00 -0700)]
[flang] Address review comment
Original-commit: flang-compiler/f18@
d6964fdd9f5ef3a34caa33922430ce5578a2e2a9
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
peter klausler [Fri, 7 Jun 2019 00:09:49 +0000 (17:09 -0700)]
[flang] Fix characterization of functions called in association selectors
Original-commit: flang-compiler/f18@
cada0c61e330b62c2adf39d8d764423503125e18
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
peter klausler [Thu, 6 Jun 2019 21:34:54 +0000 (14:34 -0700)]
[flang] Avoid segfault in association semantics by cleaning up code a bit
Original-commit: flang-compiler/f18@
04d40c3d75b0cf05e454e3b981e4a119bb8dcebb
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
peter klausler [Wed, 5 Jun 2019 22:40:59 +0000 (15:40 -0700)]
[flang] Interpret intrinsic table more correctly
Original-commit: flang-compiler/f18@
ff34f32447a8675caeae5c96549f1659c3a98ec3
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
Peter Klausler [Fri, 7 Jun 2019 17:23:27 +0000 (10:23 -0700)]
[flang] Merge pull request flang-compiler/f18#484 from flang-compiler/pmk-subscript-int
Clean up subscript-sized int definitions
Original-commit: flang-compiler/f18@
7e605795712020ea944dedfb4d2be8a30cd21fac
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
peter klausler [Fri, 7 Jun 2019 16:57:10 +0000 (09:57 -0700)]
[flang] Use ConstantSubscript as the one name for int64_t
Original-commit: flang-compiler/f18@
13870c00179a56e9a2b865c64cac1453dcbdc8e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
peter klausler [Thu, 6 Jun 2019 20:48:26 +0000 (13:48 -0700)]
[flang] Clean up subscript-sized int definitions
Original-commit: flang-compiler/f18@
256fc4e3caf2c67f282294309637657bdc76e332
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
Tree-same-pre-rewrite: false
Tim Keith [Fri, 7 Jun 2019 15:01:38 +0000 (08:01 -0700)]
[flang] Merge pull request flang-compiler/f18#487 from flang-compiler/tsk-486
Fix issue flang-compiler/f18#486
Original-commit: flang-compiler/f18@
66eaf89c09115d20a0d800ad3b1d3c62f575c057
Reviewed-on: https://github.com/flang-compiler/f18/pull/487
Tim Keith [Thu, 6 Jun 2019 23:09:11 +0000 (16:09 -0700)]
[flang] Fix issue flang-compiler/f18#486
In a function without a function result specified, the name in the
`FunctionStmt` was resolved to the function result symbol rather than
the function symbol itself. That is inconsistent with subroutines and
other functions.
The fix is to explicitly set the function name symbol after the result
has been resolved.
Original-commit: flang-compiler/f18@
b0172d32848b6135f076b3171ea55ea6f63de564
Reviewed-on: https://github.com/flang-compiler/f18/pull/487
jeanPerier [Fri, 7 Jun 2019 05:44:08 +0000 (22:44 -0700)]
[flang] Merge pull request flang-compiler/f18#471 from flang-compiler/jpr-character-intrinsic-folding
Fix UTF-8 issues and add implement some character intrinsic functions folding
Original-commit: flang-compiler/f18@
766b6c459b999ba23dbdbb64ccdf0386a3a6b2f3
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Jean Perier [Thu, 6 Jun 2019 08:34:39 +0000 (01:34 -0700)]
[flang] Remove unused captured values
Original-commit: flang-compiler/f18@
ae79e7e699d507669b88dc2c29d1f348b26f20e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Jean Perier [Wed, 5 Jun 2019 14:33:37 +0000 (07:33 -0700)]
[flang] Fix logical conflict after rebase
Original-commit: flang-compiler/f18@
93d6c1e53aada0fd6c24b2ba9103ed61d48f7965
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
Jean Perier [Wed, 5 Jun 2019 13:41:03 +0000 (06:41 -0700)]
[flang] Remove encoding related checks in achar/char
Original-commit: flang-compiler/f18@
86bc6a0252a9d47e6bacdf0941603f8d5cae4bd7
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
Jean Perier [Tue, 4 Jun 2019 09:11:58 +0000 (02:11 -0700)]
[flang] Answer first comments
Original-commit: flang-compiler/f18@
4058efcd9c413f90aeeb9fdb83608bcb4a647e6e
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
Jean Perier [Tue, 28 May 2019 14:00:40 +0000 (07:00 -0700)]
[flang] Implement folding of IACHAR, ICHAR, CHAR, ACHAR, ADJUSTL, ADJUSTR
Original-commit: flang-compiler/f18@
e8e8071e937a437e39c7f366d6368da934f50376
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
Jean Perier [Tue, 28 May 2019 09:15:05 +0000 (02:15 -0700)]
[flang] Fix UTF-8 bugs and add related tests
Original-commit: flang-compiler/f18@
9dd19ede9ed76570653d698bd1261950e74dda4b
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
Jean Perier [Fri, 24 May 2019 08:03:03 +0000 (01:03 -0700)]
[flang] checkpoint character intrinsic folding
Original-commit: flang-compiler/f18@
f495ed92bd1291b6efdb378da79f8f0a9741e15e
Reviewed-on: https://github.com/flang-compiler/f18/pull/471
Tree-same-pre-rewrite: false
jeanPerier [Fri, 7 Jun 2019 05:43:17 +0000 (22:43 -0700)]
[flang] Merge pull request flang-compiler/f18#483 from flang-compiler/jpr-482-fix
Fix issue flang-compiler/f18#482 related to folding warnings
Original-commit: flang-compiler/f18@
8532032960b684685933efab9e23bd866a14a370
Reviewed-on: https://github.com/flang-compiler/f18/pull/483
Jean Perier [Thu, 6 Jun 2019 14:41:57 +0000 (07:41 -0700)]
[flang] Address formatting comment
Original-commit: flang-compiler/f18@
0f5fb6e75a6217a404048a74d5b02d908857fbc0
Reviewed-on: https://github.com/flang-compiler/f18/pull/483
Jean Perier [Thu, 6 Jun 2019 11:24:42 +0000 (04:24 -0700)]
[flang] Remove OS dependency in folding test
Original-commit: flang-compiler/f18@
3728898ea9e16eb04510894cf95feaddf8f4fd63
Reviewed-on: https://github.com/flang-compiler/f18/pull/483
Tree-same-pre-rewrite: false
Jean Perier [Thu, 6 Jun 2019 10:24:35 +0000 (03:24 -0700)]
[flang] Fix 482: do not check floating point environment flags with clang
Original-commit: flang-compiler/f18@
fc423c151654055e50c3fad563be4e0a6afd7348
Reviewed-on: https://github.com/flang-compiler/f18/pull/483
Tree-same-pre-rewrite: false
Peter Klausler [Thu, 6 Jun 2019 22:02:29 +0000 (15:02 -0700)]
[flang] Merge pull request flang-compiler/f18#485 from flang-compiler/pmk-iso_fortran_env
Define a placeholder for ISO_FORTRAN_ENV standard module
Original-commit: flang-compiler/f18@
927ed4283e3ff2ac6180cf725710bf6b1000b216
Reviewed-on: https://github.com/flang-compiler/f18/pull/485
peter klausler [Thu, 6 Jun 2019 20:56:22 +0000 (13:56 -0700)]
[flang] Other changes moved to their own branch.
Original-commit: flang-compiler/f18@
6a922d085af655c2345dfe1c6f2360982728e55f
Reviewed-on: https://github.com/flang-compiler/f18/pull/485
peter klausler [Thu, 6 Jun 2019 20:42:33 +0000 (13:42 -0700)]
[flang] Placeholder for standard module iso_fortran_env
Original-commit: flang-compiler/f18@
386ebb04901f2fc46e7a5c2e64fbfa0586065acb
Reviewed-on: https://github.com/flang-compiler/f18/pull/485
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 5 Jun 2019 16:13:20 +0000 (09:13 -0700)]
[flang] Merge pull request flang-compiler/f18#480 from flang-compiler/pmk-fixes
Fix two bugs
Original-commit: flang-compiler/f18@
9023d3c3ac5993d0703d77a2c48247aef999000e
Reviewed-on: https://github.com/flang-compiler/f18/pull/480
peter klausler [Wed, 5 Jun 2019 16:12:21 +0000 (09:12 -0700)]
[flang] Apply suggestion from code review
Original-commit: flang-compiler/f18@
211c99917c60c6d2ae9efe260515b0b182a2136f
Reviewed-on: https://github.com/flang-compiler/f18/pull/480
peter klausler [Wed, 5 Jun 2019 00:03:34 +0000 (17:03 -0700)]
[flang] Fix two bugs
Original-commit: flang-compiler/f18@
919e512c083c1e145cdc2dec1d2af2d4a3df4bcf
Reviewed-on: https://github.com/flang-compiler/f18/pull/480
Tree-same-pre-rewrite: false
Peter Klausler [Wed, 5 Jun 2019 16:11:50 +0000 (09:11 -0700)]
[flang] Merge pull request flang-compiler/f18#479 from flang-compiler/pmk-unparse-expr
Unparse the typedExpr from semantics
Original-commit: flang-compiler/f18@
f41b303b96ffe03c28619e6e84cfbbcaa18e1a08
Reviewed-on: https://github.com/flang-compiler/f18/pull/479