Commit graph

1919 commits

Author SHA1 Message Date
peter klausler
7d24cebc17 [flang] Rearrange some move(get<>()) calls into get<>(move()) to dodge GCC possibly-uninit warnings (bogus)
Original-commit: flang-compiler/f18@f369c6025c
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false
2019-06-18 15:15:22 -07:00
peter klausler
b3c7a79e2d [flang] -fno-exceptions
Original-commit: flang-compiler/f18@81d09c2053
Reviewed-on: https://github.com/flang-compiler/f18/pull/503
Tree-same-pre-rewrite: false
2019-06-18 14:11:55 -07:00
Peter Klausler
88f3c99f35 [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@7a68cf0706
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
2019-06-18 14:01:11 -07:00
peter klausler
f753cf3eb0 [flang] Review comments and last (?) bugs
Original-commit: flang-compiler/f18@db8302e3ab
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
2019-06-18 13:46:54 -07:00
peter klausler
fdcdd504b3 [flang] more fixes from tests
Original-commit: flang-compiler/f18@bb8df72635
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-18 12:34:23 -07:00
peter klausler
94a667bb94 [flang] nag debugged
Original-commit: flang-compiler/f18@ab91b7c191
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:10 -07:00
peter klausler
fd54622481 [flang] fixes
Original-commit: flang-compiler/f18@f504e6a938
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:10 -07:00
peter klausler
7c4b790c5e [flang] All fixed except for a few NAG differences
Original-commit: flang-compiler/f18@8dea4fb760
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:09 -07:00
peter klausler
8971f7f2b3 [flang] More debugging vs. regression tests
Original-commit: flang-compiler/f18@d4fd4ad1ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:08 -07:00
peter klausler
6911444f76 [flang] Fixes
Original-commit: flang-compiler/f18@73edc5bf2b
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:08 -07:00
peter klausler
15af2b2f06 [flang] Character set and encoding changes
Original-commit: flang-compiler/f18@a550cbd4c0
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:07 -07:00
peter klausler
e7a21f763a [flang] Tests pass
Original-commit: flang-compiler/f18@ae9d07a2ab
Reviewed-on: https://github.com/flang-compiler/f18/pull/496
Tree-same-pre-rewrite: false
2019-06-17 16:13:07 -07:00
Tim Keith
b3d95433c4 [flang] Merge pull request flang-compiler/f18#502 from flang-compiler/tsk3
Handle nested interface blocks

Original-commit: flang-compiler/f18@a3c6c70b99
Reviewed-on: https://github.com/flang-compiler/f18/pull/502
2019-06-17 13:12:10 -07:00
Tim Keith
7d464b02c6 [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@0c468b60b1
Reviewed-on: https://github.com/flang-compiler/f18/pull/502
2019-06-14 15:04:13 -07:00
Jinxin (Brian) Yang
e98f7aeb94 [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@76947faa46
Reviewed-on: https://github.com/flang-compiler/f18/pull/501
2019-06-14 09:00:02 -07:00
Jinxin Yang
1e33dfb431 [flang] Add missing IS_DEVICE_PTR and LINK clauses for OpenMP parsing
Original-commit: flang-compiler/f18@541d4031e0
Reviewed-on: https://github.com/flang-compiler/f18/pull/501
2019-06-13 15:33:15 -07:00
Steve Scalpone
55abea96dd [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@391926949b
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
2019-06-12 21:02:57 -07:00
Steve Scalpone
057fb5c2d0 [flang] Remove extra spaces.
Original-commit: flang-compiler/f18@777bf033b5
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
2019-06-12 21:01:26 -07:00
Steve Scalpone
43b6209ed9 [flang] Our coding conventions prohibit rtti; enforce with the -fno-rtti compilation flag.
Original-commit: flang-compiler/f18@d2817cc9c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/497
Tree-same-pre-rewrite: false
2019-06-12 17:01:41 -07:00
Tim Keith
b12a092024 [flang] Merge pull request flang-compiler/f18#494 from flang-compiler/tsk4
Resolve and check names in equivalence sets

Original-commit: flang-compiler/f18@b1cc835872
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
2019-06-12 14:49:32 -07:00
Tim Keith
9d125624f6 [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@0b4050b2d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
2019-06-12 12:38:04 -07:00
Tim Keith
9ef62dbb6a [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@1cc898e5b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/494
Tree-same-pre-rewrite: false
2019-06-11 18:26:48 -07:00
Peter Klausler
b387e7139d [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@41d0c06701
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
2019-06-11 13:03:58 -07:00
peter klausler
fa205d1424 [flang] Improve clarity per review comment
Original-commit: flang-compiler/f18@7206c08f2a
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
2019-06-11 12:50:27 -07:00
peter klausler
a306d92675 [flang] Fix bug flang-compiler/f18#491 (and replace a misleading name)
Original-commit: flang-compiler/f18@d0d154e312
Reviewed-on: https://github.com/flang-compiler/f18/pull/492
Tree-same-pre-rewrite: false
2019-06-11 12:06:18 -07:00
psteinfeld
83cf7caa56 [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@b52469ecd1
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
2019-06-11 07:15:40 -07:00
Peter Steinfeld
609e2d753b [flang] Fixed situations where multiple error messages were being emitted.
Original-commit: flang-compiler/f18@ac62cfa9cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
2019-06-10 15:10:32 -07:00
Peter Steinfeld
c97f17a59f [flang] Renamed check.*do.*stmt to check.*do to better conform with the grammar.
Original-commit: flang-compiler/f18@d7419566e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 14:03:24 -07:00
Peter Steinfeld
169b8272e8 [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@219d856fdb
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 13:31:31 -07:00
Peter Steinfeld
3ab209b58e [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@2fae9edd77
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 13:31:31 -07:00
Peter Steinfeld
0bef67225a [flang] Added the machinery for REAL DO controls to be treated as a separate
extension.

Original-commit: flang-compiler/f18@1907cf8672
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 13:31:31 -07:00
Peter Steinfeld
a698d3d579 [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@04a0712766
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 13:31:31 -07:00
Peter Steinfeld
93a59505a5 [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@f484660c75
Reviewed-on: https://github.com/flang-compiler/f18/pull/478
Tree-same-pre-rewrite: false
2019-06-10 13:31:31 -07:00
Peter Klausler
cd4491bb68 [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@2880605122
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
2019-06-10 09:26:29 -07:00
peter klausler
754c88f35f [flang] Remove temporary debugging code
Original-commit: flang-compiler/f18@e7147ebfbe
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
2019-06-10 09:26:02 -07:00
peter klausler
812bda43f1 [flang] Dodge valgrind complaint by cleaning up the grammar a bit
Original-commit: flang-compiler/f18@3f9f9af1e8
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
2019-06-07 16:01:21 -07:00
peter klausler
82f119414c [flang] some clean-up
Original-commit: flang-compiler/f18@6134e1c2f2
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
2019-06-07 16:01:20 -07:00
peter klausler
7269dc8a82 [flang] Remove needless braces
Original-commit: flang-compiler/f18@edd18355be
Reviewed-on: https://github.com/flang-compiler/f18/pull/490
Tree-same-pre-rewrite: false
2019-06-07 16:01:20 -07:00
Eric Schweitz
19a5dfeacf [flang] Merge pull request flang-compiler/f18#489 from schweitzpgi/chipper
Remove the FIR directory

Original-commit: flang-compiler/f18@8ef23f0720
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
2019-06-07 13:40:50 -07:00
Eric Schweitz
5c978b94a2 [flang] remove FIR
Original-commit: flang-compiler/f18@008ad16e28
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
2019-06-07 10:20:15 -07:00
Eric Schweitz
6bbcc8c1d8 [flang] Remove the old FIR middle end from the f18 program and speed up build time.
Original-commit: flang-compiler/f18@5b410b978c
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
2019-06-07 10:19:59 -07:00
Eric Schweitz
8242853380 [flang] start splitting up afforestation so it isn't monolithic
Original-commit: flang-compiler/f18@842a42d954
Reviewed-on: https://github.com/flang-compiler/f18/pull/489
Tree-same-pre-rewrite: false
2019-06-07 10:19:45 -07:00
Peter Klausler
170198381a [flang] Merge pull request flang-compiler/f18#488 from flang-compiler/pmk-fixes
More fixes from test suite shakedown

Original-commit: flang-compiler/f18@357b834676
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
2019-06-07 13:32:15 -07:00
peter klausler
3e92bb77aa [flang] Address review comment
Original-commit: flang-compiler/f18@d6964fdd9f
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
2019-06-07 12:00:32 -07:00
peter klausler
fc61632c21 [flang] Fix characterization of functions called in association selectors
Original-commit: flang-compiler/f18@cada0c61e3
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
2019-06-07 10:24:35 -07:00
peter klausler
b408a02c14 [flang] Avoid segfault in association semantics by cleaning up code a bit
Original-commit: flang-compiler/f18@04d40c3d75
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
2019-06-07 10:24:33 -07:00
peter klausler
8a326cb7f7 [flang] Interpret intrinsic table more correctly
Original-commit: flang-compiler/f18@ff34f32447
Reviewed-on: https://github.com/flang-compiler/f18/pull/488
Tree-same-pre-rewrite: false
2019-06-07 10:24:33 -07:00
Peter Klausler
caa46e5178 [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@7e60579571
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
2019-06-07 10:23:27 -07:00
peter klausler
a28607f837 [flang] Use ConstantSubscript as the one name for int64_t
Original-commit: flang-compiler/f18@13870c0017
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
2019-06-07 09:57:52 -07:00
peter klausler
c26b696085 [flang] Clean up subscript-sized int definitions
Original-commit: flang-compiler/f18@256fc4e3ca
Reviewed-on: https://github.com/flang-compiler/f18/pull/484
Tree-same-pre-rewrite: false
2019-06-07 09:57:49 -07:00