Commit graph

2017 commits

Author SHA1 Message Date
David Truby 98223835c0 [flang] Added comment about gcc function cast workaround.
Original-commit: flang-compiler/f18@28bc021323
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
2019-10-01 11:15:43 +01:00
David Truby c579118ce6 [flang] Replace access through union with reinterpret_cast.
This avoids undefined behaviour.

Original-commit: flang-compiler/f18@e289bbfa83
Reviewed-on: https://github.com/flang-compiler/f18/pull/767
Tree-same-pre-rewrite: false
2019-09-30 12:41:34 +01:00
Eric Schweitz 7d1696b3ad [flang] add initial Burnside bridge code
Original-commit: flang-compiler/f18@0d387d1468
Reviewed-on: https://github.com/flang-compiler/f18/pull/720
2019-10-02 10:54:12 -07:00
Pete Steinfeld 855f817d9d [flang] More semantic checking for DO constructs
This time I'm adding to the checks for constraint C1137, which states
that image control statements cannot appear in a DO CONCURRENT.  The
checks I added test to see if the DO CONCURRENT contains an ALLOCATE or
DEALLOCATE that references a coarray.

Original-commit: flang-compiler/f18@c16b883db3
Reviewed-on: https://github.com/flang-compiler/f18/pull/769
2019-10-01 13:03:40 -07:00
David Truby e0c15c4952 [flang] Added grammar comments for enter data and exit data directives
Original-commit: flang-compiler/f18@a1e6cded2f
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
2019-09-27 13:57:51 +01:00
David Truby 5776003259 [flang] Corrected check for required OpenMP clauses
Original-commit: flang-compiler/f18@ce3ec50c3f
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
David Truby 7c09d48218 [flang] Corrections for map semantics to match coding style
Original-commit: flang-compiler/f18@f2d97c3a1e
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
David Truby d3e8c76f67 [flang] Added semantic checks for map clauses
Original-commit: flang-compiler/f18@75b6228388
Reviewed-on: https://github.com/flang-compiler/f18/pull/748
Tree-same-pre-rewrite: false
2019-09-27 13:57:51 +01:00
Eric Schweitz 5c8c0716b4 [flang] sync latest changes to these files
Original-commit: flang-compiler/f18@97becf30fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
2019-09-26 13:08:27 -07:00
Eric Schweitz cca3c31176 [flang] latest changes
Original-commit: flang-compiler/f18@c4278fe1aa
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-17 14:23:20 -07:00
Eric Schweitz 6bff59ec6b [flang] add FIROps.h
Original-commit: flang-compiler/f18@e53fefb66c
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-10 08:25:34 -07:00
Eric Schweitz d6bfd9135c [flang] fix name of argument
Original-commit: flang-compiler/f18@ad50545941
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-09 16:05:02 -07:00
Eric Schweitz 27e80ffd73 [flang] add attributes
Original-commit: flang-compiler/f18@d35f55b0d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 16:15:37 -07:00
Eric Schweitz 717cdbd4ac [flang] more cleanup
Original-commit: flang-compiler/f18@23fdcf77d0
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 13:37:14 -07:00
Eric Schweitz 38301e7fa0 [flang] changes per review comments
Original-commit: flang-compiler/f18@eb34e2d47b
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-09-06 13:25:42 -07:00
Eric Schweitz deef31dc7c [flang] add fir types header
Original-commit: flang-compiler/f18@4dc278b271
Reviewed-on: https://github.com/flang-compiler/f18/pull/696
Tree-same-pre-rewrite: false
2019-08-28 13:53:50 -07:00
peter klausler 6e7ed4fb4d [flang] Fix flang-compiler/f18#765
Original-commit: flang-compiler/f18@bb2ffac717
Reviewed-on: https://github.com/flang-compiler/f18/pull/766
2019-09-27 14:08:09 -07:00
Pete Steinfeld c3f05ac421 [flang] Added tests for image control statements in DO CONCURRENT
There was already code in check-do.cc to test for the presence of a
variety of different image control statements, but several of them did
not have associated tests.  This change adds tests for most of them.

Also, I removed the check for the END PROGRAM statement, since its
presence causes a syntax error which prevents the semantic check from
ever being reached.

Original-commit: flang-compiler/f18@9cc6f5bd40
Reviewed-on: https://github.com/flang-compiler/f18/pull/764
2019-09-26 13:33:48 -07:00
Tim Keith a3d2966637 [flang] Fix clang build on MacOS
clang doesn't consider `std::strlen` of a constant to be a constexpr,
so just replace with the actual length.

Original-commit: flang-compiler/f18@738deab465
Reviewed-on: https://github.com/flang-compiler/f18/pull/761
2019-09-25 15:39:44 -07:00
David Truby 5efbea87cf [flang] Added grammar for teams directive to semantic checks
Original-commit: flang-compiler/f18@1cee26516b
Reviewed-on: https://github.com/flang-compiler/f18/pull/750
2019-09-19 10:02:35 +01:00
David Truby cad44d2e91 [flang] Semantic checks for teams directive
Original-commit: flang-compiler/f18@ec22e9c4c2
Reviewed-on: https://github.com/flang-compiler/f18/pull/750
Tree-same-pre-rewrite: false
2019-09-17 12:08:04 +01:00
Steve Scalpone fdb58597e8 [flang] Update C++style.md
Original-commit: flang-compiler/f18@d453fdda31
Reviewed-on: https://github.com/flang-compiler/f18/pull/751
2019-09-17 17:07:06 -07:00
Steve Scalpone 3a25e25bd7 [flang] Update C++style.md
Add guidelines for error messages and commas.  Add a version number for clang-format. Add spaces before ### sections to restart numbering.

Original-commit: flang-compiler/f18@3e8db49f34
Reviewed-on: https://github.com/flang-compiler/f18/pull/751
Tree-same-pre-rewrite: false
2019-09-17 12:31:37 -07:00
Tim Keith 3ef61ec226 [flang] Fix tests that use the same .mod file
The tests run by `test_any.sh` don't redirect their .mod files to
a different directory so they occasionally fail when the same file
is accessed by different tests at the same time. With locking of
module files implemented, this problem reproduces much more reliably

Work around it by changing the module names to be distinct. Also remove
some comments left over when copied from `test_symbols.sh` tests.

Original-commit: flang-compiler/f18@f7b5c5f0fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/758
2019-09-25 14:55:40 -07:00
Tim Keith 73c630a4ea [flang] Improve module file reading and writing
Fix problems with writing a mod file while another compilation is
reading or writing. Write to a temp and then rename it:
- compute the new contents of the .mod file
- if it already exists, check if it is already correct
- if not, write new contents to a temp file
- rename the temp to the final destination

`mkstemps()` seems to be the best way to create the temp file.
It returns a file descriptor, so change the rest of the mod file
writing to use POSIX open/read/write/close. This seems to set
errno more reliably too.

There is some extra work around creating the temp to make it have
the same directory and suffix as the final file (so that if one gets
left behind by a crash, "rm *.mod" still cleans it up).
`mkstemps()` creates file with 0600 permissions so try to change it
to what it would have been if we just wrote the file.

Change module file reading to only read the file once; we used to
read it to verify the checksum and then again to parse it.
Instead, change `Parsing` so that we can get the file contents
after `Prescan()` and use that to verify the checksum. Also, it has
a mechanism for searching directories for files, so make use of that
instead of duplicating that functionality in `ModFileReader`.
This requires some changes to how errors are returned so they can
be reported in the right place.

Original-commit: flang-compiler/f18@d0d54971a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/758
Tree-same-pre-rewrite: false
2019-09-25 14:55:40 -07:00
peter klausler 55e241a722 [flang] Fix build on OSX
Original-commit: flang-compiler/f18@453b03af1c
Reviewed-on: https://github.com/flang-compiler/f18/pull/760
2019-09-25 10:40:01 -07:00
peter klausler ccb91afba7 [flang] Address review comments
Original-commit: flang-compiler/f18@2393157d3f
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
2019-09-25 09:04:38 -07:00
peter klausler 9fd72e9393 [flang] Clean up test results
Original-commit: flang-compiler/f18@7d3180160c
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:37 -07:00
peter klausler d8c9b50fd6 [flang] Prep for review
Original-commit: flang-compiler/f18@8be02a41c7
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:35 -07:00
peter klausler 686baf0b0e [flang] Remove dead code
Original-commit: flang-compiler/f18@4d90aad361
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:33 -07:00
peter klausler 32f2ea0753 [flang] Build with all compilers * versions
Original-commit: flang-compiler/f18@7332caa613
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:31 -07:00
peter klausler fc5d127c1c [flang] Complete conversions, delete old visitor
Original-commit: flang-compiler/f18@6ce1da55c8
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:30 -07:00
peter klausler f07d6bc6ba [flang] more conversions to Traverse
Original-commit: flang-compiler/f18@e8668e2368
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:29 -07:00
peter klausler 48fd773a19 [flang] Refinements; replace several clients of old Visitor with new Traverse
Original-commit: flang-compiler/f18@0b44a86e31
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:28 -07:00
peter klausler e6e66c022b [flang] Redo IsInitialDataTarget
Original-commit: flang-compiler/f18@988c38e1f5
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:27 -07:00
peter klausler 0bc6d134a6 [flang] Repackaging; tests pass
Original-commit: flang-compiler/f18@1fa7bb7717
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:26 -07:00
peter klausler c36f7d916a [flang] progress
Original-commit: flang-compiler/f18@b5e3e709cb
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:24 -07:00
peter klausler 8d8e1c4604 [flang] add test
Original-commit: flang-compiler/f18@ad2fa9dfdf
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:23 -07:00
peter klausler 9016b1d6a8 [flang] checkpoint
Original-commit: flang-compiler/f18@96ade8e6e9
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:22 -07:00
peter klausler e9dda4f0f5 [flang] checkpoint
Original-commit: flang-compiler/f18@782f44fe7d
Reviewed-on: https://github.com/flang-compiler/f18/pull/755
Tree-same-pre-rewrite: false
2019-09-25 09:04:20 -07:00
Pete Steinfeld ea1cf9ee0b [flang] More responses to pull request comments.
Original-commit: flang-compiler/f18@0fb4cf1c9b
Reviewed-on: https://github.com/flang-compiler/f18/pull/756
2019-09-24 15:33:51 -07:00
Pete Steinfeld 33b208e487 [flang] More responses to comments in the pull request. The big change was to
implement an enum class to indicate whether the statement being checked
is a CYCLE or EXIT statement.  This change rippled through a few
interfaces, resulting in cleaner, more readable code.  Thanks for the
tip, Tim!

Original-commit: flang-compiler/f18@e167c3d39f
Reviewed-on: https://github.com/flang-compiler/f18/pull/756
Tree-same-pre-rewrite: false
2019-09-24 10:44:44 -07:00
Pete Steinfeld e0eee884b2 [flang] Responses to a comments in my previous pull request.
Original-commit: flang-compiler/f18@e0d73a45ac
Reviewed-on: https://github.com/flang-compiler/f18/pull/756
Tree-same-pre-rewrite: false
2019-09-23 20:49:55 -07:00
Pete Steinfeld ab12314514 [flang] Implementation of semantic checks C1135, C1167, and C1168
These constraints state that CYCLE and EXIT statements should not leave DO
CONCURRENT, CRITICAL, or CHANGE TEAM constructs.

I added checking code to check-do.cc and removed some superseded code from
check-do.cc and semantics.cc.  The new code uses the construct stack
implemented in my previous pull request.

I also added a new test -- dosemantics11.f90 and modified the tests
dosemantics10.f90, doconcurrent05.f90, and doconcurrent06.f90 to adapt to
the new error messages.  I converted these latter two tests to use
test_error.sh since they only reported errors.

Original-commit: flang-compiler/f18@b0bea7da64
Reviewed-on: https://github.com/flang-compiler/f18/pull/756
Tree-same-pre-rewrite: false
2019-09-23 20:49:55 -07:00
Jean Perier cd15ba5360 [flang] Fix typos and style in some comments
Original-commit: flang-compiler/f18@621ded353f
Reviewed-on: https://github.com/flang-compiler/f18/pull/749
2019-09-18 08:04:52 -07:00
Jean Perier 00c02c469c [flang] Refactor IntrinsicProcTable::Implementation::Probe for readability
Original-commit: flang-compiler/f18@4a7211e42b
Reviewed-on: https://github.com/flang-compiler/f18/pull/749
Tree-same-pre-rewrite: false
2019-09-18 05:15:56 -07:00
Jean Perier 9a01a4915e [flang] Address editorial comments and use oxford comma
Original-commit: flang-compiler/f18@88a8d1be03
Reviewed-on: https://github.com/flang-compiler/f18/pull/749
Tree-same-pre-rewrite: false
2019-09-17 01:54:51 -07:00
Jean Perier d8fc41f612 [flang] Allow more argument types in some specific intrinsic
Fix flang-compiler/f18#724.
Allow all type kinds for arguments in restricted specific conversion
intrinisc (no warning, this is ubiquitous).
Allow MAX/MIN restricted intrinsic (AMAX0...) to be replaced by the
related generic foolowed by a type conversion to the expected result
type of the specific. Emit a warning because xlf and ifort are doing so
but pgfortran is converting the arguments instead.

Original-commit: flang-compiler/f18@c07adb94ed
Reviewed-on: https://github.com/flang-compiler/f18/pull/749
Tree-same-pre-rewrite: false
2019-09-16 09:34:10 -07:00
Tim Keith 493a135a56 [flang] Handle alternative names for relational operators
10.1.6.2 says:
> The operators <, <=, >, >=, ==, and /= always have the same interpretations
> as the operators .LT., .LE., .GT., .GE., .EQ., and .NE., respectively.
That means we have to treat `operator(<)` like `operator(.lt.)`,
for example. `<>` is a third alias for `.NE.`.

We can't just choose always to use one form (e.g. replacing `operator(.lt.)`
with `operator(<)`). This is because all symbols names are `CharBlock`s
referring to the cooked character stream so that they have proper source
provenance. Also, if a user prefers one style and uses it consistently,
that's the form they should see in messages.

So the fix is to use whatever form is found in the source, but also to
look up symbols by the other names when necessary. To assist this, add
`GenericSpecInfo::GetAllNames()` to return all of the names of a generic
spec. Each place a generic spec can occur we have to use these to look
for the symbol.

Also reorganize the `AddUse()` overloads to work with this change.

Fixes flang-compiler/f18#746.

Original-commit: flang-compiler/f18@7f06f175d5
Reviewed-on: https://github.com/flang-compiler/f18/pull/752
2019-09-19 15:18:33 -07:00
Tim Keith b506f39f18 [flang] Clean up temp dirs
A temp directory is created in `common.sh` and it is cleaned up by
`trap ... EXIT`. If the test script has its own trap, as this one does,
it seems to replace the first one. So the cleanup from `common.sh` was
not being executed when the `%t` feature was used and empty temp
directories were being left in the directory where the tests ran.

Since we already have a temp directory that is cleaned up, just use
that for `%t` and don't bother with another `mktemp`.

Original-commit: flang-compiler/f18@f61d62ddec
Reviewed-on: https://github.com/flang-compiler/f18/pull/754
2019-09-18 13:17:48 -07:00