Commit graph

2033 commits

Author SHA1 Message Date
Tim Keith
473658dd86 [flang] Fix test_folding.sh to work on MacOS
There were a couple of small incompatibilities:
- There is no `ldd` on MacOS; instead use `otools -L`.
  This has not been tested when libpgmath is linked in to f18.
- `wc` outputs spaces where on Linux it outputs tabs; change how
  the number of lines is extracted to work on both.

Also, fix a bug: change `passed_warnings` to `$passed_warnings`.

Original-commit: flang-compiler/f18@5bede9e188
Reviewed-on: https://github.com/flang-compiler/f18/pull/475
2019-06-03 13:21:35 -07:00
Tim Keith
017ed5292b [flang] Merge pull request flang-compiler/f18#462 from flang-compiler/tsk-doc
Update description of semantic analysis

Original-commit: flang-compiler/f18@f4ae518a89
Reviewed-on: https://github.com/flang-compiler/f18/pull/462
2019-06-03 13:28:10 -07:00
Tim Keith
829ea91949 [flang] Address more review comments
Original-commit: flang-compiler/f18@c7b3a39aa5
Reviewed-on: https://github.com/flang-compiler/f18/pull/462
2019-05-15 12:47:23 -07:00
Tim Keith
610438498c [flang] Fix typos, adjust nested list formatting
Original-commit: flang-compiler/f18@c07a86ce21
Reviewed-on: https://github.com/flang-compiler/f18/pull/462
Tree-same-pre-rewrite: false
2019-05-15 07:14:03 -07:00
Tim Keith
9e012ca714 [flang] Update description of semantic analysis
Semantics.md described the plans for semantic analysis as of some
time ago. Update it to document what has been implemented.

Original-commit: flang-compiler/f18@d32e340671
Reviewed-on: https://github.com/flang-compiler/f18/pull/462
Tree-same-pre-rewrite: false
2019-05-14 20:01:07 -07:00
Peter Klausler
f31558ec9e [flang] Merge pull request flang-compiler/f18#472 from flang-compiler/pmk-ta-fixes
Roll up some fixes to problems found running more correctness tests

Original-commit: flang-compiler/f18@8e192713ac
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
2019-05-30 16:45:03 -07:00
peter klausler
710a5147cd [flang] Reformatting before merging
Original-commit: flang-compiler/f18@9f084c1da6
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
2019-05-30 16:39:23 -07:00
peter klausler
c3ce68c1ee [flang] Two more fixes made while waiting for code review
Original-commit: flang-compiler/f18@6dc58004ab
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-30 16:14:24 -07:00
peter klausler
535484e2cc [flang] Address review comment
Original-commit: flang-compiler/f18@17be1f6a7d
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-30 15:26:54 -07:00
peter klausler
d3b23e9dd6 [flang] Handle large integer literals without kinds better
Original-commit: flang-compiler/f18@381ea32d57
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-30 13:31:11 -07:00
peter klausler
616337dbf3 [flang] document non-support for PGI ALLOCATE(TYPE(t)::...)
Original-commit: flang-compiler/f18@67420da79c
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-30 12:08:06 -07:00
peter klausler
d49aa3c57c [flang] Final fixes before review
Original-commit: flang-compiler/f18@efe5c1b8ec
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-29 16:00:31 -07:00
peter klausler
f4b1209f4b [flang] PRECISION, RANGE, RADIX
Original-commit: flang-compiler/f18@de0bf5a18f
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-29 15:38:33 -07:00
peter klausler
eff41b8fa7 [flang] Complete folding of intermixed array and component references
Original-commit: flang-compiler/f18@70db03e4ac
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-29 13:22:35 -07:00
peter klausler
4cd29d1002 [flang] Fix intrinsic folding after merging changes
Original-commit: flang-compiler/f18@a982c34b6f
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-28 15:42:28 -07:00
peter klausler
d29530e1c4 [flang] Defer conversions to objects; fix some intrinsic table entries
more fixes

Access components of constant structures

Apply implicit typing to dummy args used in automatic array dimensions

SELECTED_INT_KIND and SELECTED_REAL_KIND

Finish SELECTED_{INT,REAL}_KIND and common cases of ALL()/ANY()

Original-commit: flang-compiler/f18@e9f8e53e55
Reviewed-on: https://github.com/flang-compiler/f18/pull/472
Tree-same-pre-rewrite: false
2019-05-28 13:29:29 -07:00
jeanPerier
bb66d8ef41 [flang] Merge pull request flang-compiler/f18#468 from flang-compiler/jpr-folding-warnings
Add location to folding warnings and related tests and prevent spurious "re-folding"

Original-commit: flang-compiler/f18@0b2b40ae99
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
2019-05-27 02:14:37 -07:00
Jean Perier
0dfecfa8c5 [flang] Add semantic error test for integer constant containing division by zero
Original-commit: flang-compiler/f18@650cfac539
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
2019-05-24 08:22:11 -07:00
Jean Perier
33d6fb2332 [flang] Make integer divide by zero in constants a fatal error
Original-commit: flang-compiler/f18@e5acff6b63
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:57 -07:00
Jean Perier
3e0e884338 [flang] removed a relicate comment
Original-commit: flang-compiler/f18@f25113b84e
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:50 -07:00
Jean Perier
49c8d329b7 [flang] Fix support of parenthesized arguments in function folding
Original-commit: flang-compiler/f18@1ecb07cddf
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:44 -07:00
Jean Perier
fcf951b4d4 [flang] more folding edge cases tests
Original-commit: flang-compiler/f18@21c0ec4cc4
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:42 -07:00
Jean Perier
ccd47f072c [flang] Adding tests for folding edge case (overflows...)
Original-commit: flang-compiler/f18@6893775dee
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:41 -07:00
Jean Perier
f62528535e [flang] Folding improvments:
- Add location to non-fatal error message (context was not given
    a location before folding in semantics).
  - Avoid refolding expression from scratch several times (update GenericExprWrapper
    after folding). So far, warning messages were generated twice per parametere init
    expressions.

Original-commit: flang-compiler/f18@bf7f6cf9cd
Reviewed-on: https://github.com/flang-compiler/f18/pull/468
Tree-same-pre-rewrite: false
2019-05-24 07:55:40 -07:00
Jinxin (Brian) Yang
f5e1bc1a92 [flang] Merge pull request flang-compiler/f18#470 from flang-compiler/by-mp-gram
Re-write OpenMP 4.5 grammar documentation

Original-commit: flang-compiler/f18@bac3a89f81
Reviewed-on: https://github.com/flang-compiler/f18/pull/470
2019-05-24 14:25:16 -07:00
Jinxin Yang
67ebc0064a [flang] improvement for atomic construct
Original-commit: flang-compiler/f18@d57ef4a669
Reviewed-on: https://github.com/flang-compiler/f18/pull/470
2019-05-24 13:54:58 -07:00
Jinxin Yang
083bc9c6a1 [flang] improvement for 'Re-write OpenMP 4.5 grammar doc with BNF'
Original-commit: flang-compiler/f18@e17e74104b
Reviewed-on: https://github.com/flang-compiler/f18/pull/470
Tree-same-pre-rewrite: false
2019-05-24 13:45:15 -07:00
Jinxin Yang
80c9995a19 [flang] Re-write OpenMP 4.5 grammar doc with BNF
Original-commit: flang-compiler/f18@fe06ea9f60
Reviewed-on: https://github.com/flang-compiler/f18/pull/470
Tree-same-pre-rewrite: false
2019-05-23 17:13:52 -07:00
jeanPerier
28f6e62fcc [flang] Merge pull request flang-compiler/f18#469 from flang-compiler/jpr-fold-parameter-fix
Prevent possible infinite loop in parameter folding

Original-commit: flang-compiler/f18@debeaedfc3
Reviewed-on: https://github.com/flang-compiler/f18/pull/469
2019-05-24 01:39:00 -07:00
Jean Perier
6bcb3cac84 [flang] add test for parameter infinite loop
Original-commit: flang-compiler/f18@552568c397
Reviewed-on: https://github.com/flang-compiler/f18/pull/469
2019-05-23 02:13:01 -07:00
Jean Perier
e5f396511d [flang] fix error message typo
Original-commit: flang-compiler/f18@049163e0d4
Reviewed-on: https://github.com/flang-compiler/f18/pull/469
Tree-same-pre-rewrite: false
2019-05-23 02:09:58 -07:00
Jean Perier
15630a4ddd [flang] Prevent possible infinte loop in parameter folding
Original-commit: flang-compiler/f18@38360930ce
Reviewed-on: https://github.com/flang-compiler/f18/pull/469
Tree-same-pre-rewrite: false
2019-05-22 08:26:50 -07:00
Peter Klausler
64a13fda35 [flang] Merge pull request flang-compiler/f18#464 from flang-compiler/klausler-patch-1
Update FortranForCProgrammers.md

Original-commit: flang-compiler/f18@a165954644
Reviewed-on: https://github.com/flang-compiler/f18/pull/464
2019-05-23 08:40:19 -07:00
Peter Klausler
849597f4f9 [flang] Update FortranForCProgrammers.md
Refine the text describing differences between C and Fortran pointers to correct an erroneous statement (that pointers cannot point to allocatables).  Fixes bug flang-compiler/f18#461.

Original-commit: flang-compiler/f18@eaa3c10aa8
Reviewed-on: https://github.com/flang-compiler/f18/pull/464
2019-05-15 13:37:10 -07:00
jeanPerier
74f5d6e308 [flang] Merge pull request flang-compiler/f18#467 from flang-compiler/jpr-allocate-checks
Fix: catch subroutine symbols in ALLOCATE

Original-commit: flang-compiler/f18@730191fcaf
Reviewed-on: https://github.com/flang-compiler/f18/pull/467
2019-05-23 00:40:42 -07:00
Jean Perier
d146db54ca [flang] Fix: catch subroutine symbols in ALLOCATE
Original-commit: flang-compiler/f18@99d4b3dcd6
Reviewed-on: https://github.com/flang-compiler/f18/pull/467
2019-05-22 08:00:19 -07:00
Peter Klausler
e3d361d98f [flang] Merge pull request flang-compiler/f18#466 from flang-compiler/pmk1
Fixes to problems in (mostly) expression semantics

Original-commit: flang-compiler/f18@c501ef36fa
Reviewed-on: https://github.com/flang-compiler/f18/pull/466
2019-05-21 11:04:56 -07:00
peter klausler
7026445c07 [flang] Address review comments from Jean (thanks!)
Original-commit: flang-compiler/f18@5183c6196e
Reviewed-on: https://github.com/flang-compiler/f18/pull/466
2019-05-21 10:24:30 -07:00
peter klausler
59342b0641 [flang] work in progress
checkpoint: changes build, tests all pass

many fixes, ready to test more

Further CLASS(*) support

More fixes for CLASS(*)

Hide data members of DynamicType

implement PRESENT() intrinsic

Original-commit: flang-compiler/f18@044ba12c20
Reviewed-on: https://github.com/flang-compiler/f18/pull/466
Tree-same-pre-rewrite: false
2019-05-20 13:37:28 -07:00
Peter Klausler
16ceaadfd8 [flang] Merge pull request flang-compiler/f18#465 from flang-compiler/pmk-fix-tim
Fix crash reported by Tim

Original-commit: flang-compiler/f18@6ad320265a
Reviewed-on: https://github.com/flang-compiler/f18/pull/465
2019-05-15 15:42:30 -07:00
peter klausler
d0fcb7681a [flang] Fix crash reported by Tim
Original-commit: flang-compiler/f18@7fe2d197ea
Reviewed-on: https://github.com/flang-compiler/f18/pull/465
2019-05-15 13:23:31 -07:00
Peter Klausler
a3f11a3163 [flang] Merge pull request flang-compiler/f18#463 from flang-compiler/pmk-fix-brian
Fix bug with comment clipping on compiler directives

Original-commit: flang-compiler/f18@9307806d7a
Reviewed-on: https://github.com/flang-compiler/f18/pull/463
2019-05-15 13:24:03 -07:00
peter klausler
9a13ea959c [flang] Fix bug with comment clipping on compiler directives
Original-commit: flang-compiler/f18@3f4375c57c
Reviewed-on: https://github.com/flang-compiler/f18/pull/463
2019-05-15 12:35:36 -07:00
Peter Klausler
f6981e4919 [flang] Merge pull request flang-compiler/f18#460 from flang-compiler/pmk-fix-brian
Strip comments from source and directive lines after macro replacement

Original-commit: flang-compiler/f18@ab5794470a
Reviewed-on: https://github.com/flang-compiler/f18/pull/460
2019-05-13 09:30:53 -07:00
peter klausler
01a3e1b80e [flang] Strip comments from source and directive lines after macro replacement
Original-commit: flang-compiler/f18@ecf22e6698
Reviewed-on: https://github.com/flang-compiler/f18/pull/460
2019-05-10 16:04:10 -07:00
Tim Keith
f2dbeb04e5 [flang] Merge pull request flang-compiler/f18#455 from flang-compiler/tsk4
Change parse tree to allow DO loop over REAL

Original-commit: flang-compiler/f18@2771ee8dd8
Reviewed-on: https://github.com/flang-compiler/f18/pull/455
2019-05-09 14:10:46 -07:00
Tim Keith
cae5ce3d27 [flang] Update extensions doc for DO loop over REAL
Original-commit: flang-compiler/f18@bc8ea466fc
Reviewed-on: https://github.com/flang-compiler/f18/pull/455
2019-05-09 10:04:46 -07:00
Tim Keith
4c4f4d2807 [flang] Address review comments
Use better names for template parameters of `LoopBounds`, and also
for the constructor arguments.

Use two overloadings of `loopBounds()` instead of `std::is_same_v<>`.

Original-commit: flang-compiler/f18@a2c0c75462
Reviewed-on: https://github.com/flang-compiler/f18/pull/455
Tree-same-pre-rewrite: false
2019-05-09 10:00:13 -07:00
Tim Keith
351dc98948 [flang] Change parse tree to allow DO loop over REAL
It is a common extension to allow DO loops with REAL variable and
bounds. The parse tree currently parses those with the variable
as `scalar-int-variable-name` and the bounds as `scalar-int-expr`.
That causes the INTEGER constraint to be enforced automatically.

Change the grammar and parse tree to treat them as `scalar-variable-name`
and `scalar-expr`. This allows the name and expression to be REAL,
but we will have to verify that they aren't any other type (in a future
change).

To accomplish this, add a template parameter to `LoopBounds` for the type
of the variable name (always `Scalar<Name>` or `Scalar<Integer<Name>>`).
We sometimes need names for the instantiations of `LoopBounds` so add
type aliases like `LoopControl::Bounds` for each one.

Original-commit: flang-compiler/f18@d75aa03970
Reviewed-on: https://github.com/flang-compiler/f18/pull/455
Tree-same-pre-rewrite: false
2019-05-09 08:33:28 -07:00
psteinfeld
ea38f1ef5e [flang] Merge pull request flang-compiler/f18#452 from flang-compiler/ps_do_c1121
Added a test for C1121, DO scalar-mask-expr cannot reference IMPURE procedure

Original-commit: flang-compiler/f18@83842cc1b8
Reviewed-on: https://github.com/flang-compiler/f18/pull/452
2019-05-09 11:02:07 -07:00