Commit graph

1241 commits

Author SHA1 Message Date
peter klausler
af958345ce [flang] Use operator<< in test.
Original-commit: flang-compiler/f18@e3f321e9f0
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 13:03:26 -07:00
peter klausler
547a0601f1 [flang] Logical operation precedence
Original-commit: flang-compiler/f18@060bc39fb4
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 13:01:42 -07:00
peter klausler
9e9b9f0776 [flang] Pass tests
Original-commit: flang-compiler/f18@ffb057f262
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 12:30:08 -07:00
peter klausler
b35f4a98e2 [flang] work in progress
Original-commit: flang-compiler/f18@33ea8e506a
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:59:00 -07:00
peter klausler
95b4e65ecf [flang] Move some AsFortran() implementations into new formatting.cc; use precedence for parentheses
Original-commit: flang-compiler/f18@2b5fa051df
Reviewed-on: https://github.com/flang-compiler/f18/pull/371
Tree-same-pre-rewrite: false
2019-04-01 10:58:55 -07:00
peter klausler
4d21120d89 [flang] Add extension edit descriptors to the unparser.
Original-commit: flang-compiler/f18@74e09e249a
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
2019-04-01 10:14:20 -07:00
peter klausler
e0f76d2306 [flang] Support CONVERT= and DISPOSE= on INQUIRE
Original-commit: flang-compiler/f18@fbedd32376
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:19 -07:00
peter klausler
822810f017 [flang] Check int literals for overflow when kind is known.
improve test

Original-commit: flang-compiler/f18@09ce783cd3
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:16 -07:00
peter klausler
1d2a212c38 [flang] Allow dollar and backslash formats
Original-commit: flang-compiler/f18@4d8d6e599e
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:15 -07:00
peter klausler
5b0e18b0e4 [flang] Allow multiple associations on legacy POINTER declaration
fix that fix

Original-commit: flang-compiler/f18@f096b73842
Reviewed-on: https://github.com/flang-compiler/f18/pull/352
Tree-same-pre-rewrite: false
2019-04-01 10:14:12 -07:00
Jean Perier
f9ab321ed4 [flang] Address review comment
Original-commit: flang-compiler/f18@1e3b3b457d
2019-04-01 01:39:19 -07:00
Jean Perier
3774e9d173 [flang] Update documentation with status of intrinsic procedure support in f18
Original-commit: flang-compiler/f18@aa12037a5b
Tree-same-pre-rewrite: false
2019-03-29 08:48:39 -07:00
Jean Perier
382aafad68 [flang] Remove useless dummy return statements
I first added these because I had issues with return type deduction
in lambdas, but they are actually useless when the return type is
specified in the lambda signature.

Original-commit: flang-compiler/f18@5bcbbd8bdc
Tree-same-pre-rewrite: false
2019-03-29 04:30:35 -07:00
Peter Steinfeld
8586f299e3 [flang] This test fails when the directory in which test tests are run contains a path that matches the pattern "do *[1-9]". In my case, I had a directory called "do1". The "*" is not necessary in the pattern. Now the test passes unless the directory contains a " ".
Original-commit: flang-compiler/f18@462f15e4e7
Reviewed-on: https://github.com/flang-compiler/f18/pull/365
2019-03-28 17:17:30 -07:00
Jean Perier
9f98662b5f [flang] Fix F18 scalar integer power algorithm
Original-commit: flang-compiler/f18@f0609e7ace
2019-03-28 08:18:42 -07:00
Jean Perier
eb52525b91 [flang] Add todo for bessel function default support
Original-commit: flang-compiler/f18@3842e7f5ac
2019-03-29 01:41:26 -07:00
Jean Perier
47251f2db0 [flang] Fix compilation failure on PowerPC
Original-commit: flang-compiler/f18@f79f4973b6
Tree-same-pre-rewrite: false
2019-03-28 06:53:52 -07:00
Jean Perier
07f6963dbb [flang] Remove non standard use of bessel C functions
Original-commit: flang-compiler/f18@a40559372a
Tree-same-pre-rewrite: false
2019-03-28 04:25:13 -07:00
Jean Perier
1d4323ddd5 [flang] Silence GCC 8.1 spurious warning
Original-commit: flang-compiler/f18@69e05d0632
Tree-same-pre-rewrite: false
2019-03-28 02:34:32 -07:00
Steve Scalpone
1de9ecd251 [flang] Add CMake rules to install static and shared libraries in
the default install directory or in the directory specified
with CMAKE_INSTALL_PREFIX.  Fixes flang-compiler/f18#359.

Original-commit: flang-compiler/f18@35ce1628e2
Reviewed-on: https://github.com/flang-compiler/f18/pull/364
2019-03-28 09:55:56 -07:00
Tim Keith
3e8c62b48b [flang] Track current statement location in SemanticsVisitor
Change `SemanticsVisitor` to track the location of the current
statement, if any, so that it's available through
`SemanticsContext::location()`

Add overloading of `SemanticsContext::Say()` that reports the
message at the location of the current statement if a `CharBlock`
is not provided.

Original-commit: flang-compiler/f18@5185c721ee
Reviewed-on: https://github.com/flang-compiler/f18/pull/357
2019-03-26 12:40:13 -07:00
Steve Scalpone
b8ce6f11ad [flang] Removed unused #include files from check-computed-goto.cc.
Did the same for a few other similar files.

Original-commit: flang-compiler/f18@6f7569b938
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
2019-03-27 20:46:51 -07:00
Steve Scalpone
fa2e6374ce [flang] Fix typo: "check" becomes "checked"
Original-commit: flang-compiler/f18@2b2b0bf324
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Tree-same-pre-rewrite: false
2019-03-27 15:48:46 -07:00
Steve Scalpone
7024515c7d [flang] Implement semantics for computed GOTO. Note that a PGI extension
will implicitly convert a float to integer (and issue a warning).
This commit does not implement that extension.

Original-commit: flang-compiler/f18@b85755f26f
Reviewed-on: https://github.com/flang-compiler/f18/pull/360
Tree-same-pre-rewrite: false
2019-03-27 15:44:17 -07:00
Eric Schweitz
de2f753810 [flang] add comment per Steve's request in review
Original-commit: flang-compiler/f18@c3a5d6a15e
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
2019-03-27 16:03:52 -07:00
Eric Schweitz
1b7aea8ebc [flang] Change per Jean's review comment
Original-commit: flang-compiler/f18@9a3a79927b
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-27 08:58:59 -07:00
Eric Schweitz
dbccd231ba [flang] remove use of undefined behavior
Original-commit: flang-compiler/f18@d7c5879f2c
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-25 19:16:41 -07:00
Eric Schweitz
1410957864 [flang] temporary symbol creation and improve dump routine
check for labels on construct delimiting statements
ifdef out code to avoid warning

Original-commit: flang-compiler/f18@667674aaa0
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-25 09:29:01 -07:00
Eric Schweitz
15d3eb92e5 [flang] remove the DO stub instructions
Original-commit: flang-compiler/f18@f1ddcd8d76
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
f76ba41bb3 [flang] build up expressions implied by DO loop construct
Original-commit: flang-compiler/f18@1e7b9adb62
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
19ec665cbf [flang] simplify switch builders
Original-commit: flang-compiler/f18@787ee1fecd
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
84264dc79b [flang] improved output on flat fir
Original-commit: flang-compiler/f18@9be07963a5
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
9e98210438 [flang] refactor linear representation -> flattened
Original-commit: flang-compiler/f18@4253e2484f
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
73ee96f7ce [flang] replace GenericExprWrapper with Expr<SomeType>
Original-commit: flang-compiler/f18@0821d00cb8
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Eric Schweitz
00a3ccd91d [flang] FIR: more code cleanup
Original-commit: flang-compiler/f18@eaac944aca
Reviewed-on: https://github.com/flang-compiler/f18/pull/354
Tree-same-pre-rewrite: false
2019-03-23 11:14:20 -07:00
Jean Perier
236eeef974 [flang] Only have cmake look for libpgmath if LIBPGMATH_DIR is given
Original-commit: flang-compiler/f18@1d778f5c1a
2019-03-27 10:16:07 -07:00
Jean Perier
be5cfaa5c7 [flang] fix clang errors and warnings
Original-commit: flang-compiler/f18@410f96384f
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
cabcd851e6 [flang] Prepare to be merged with master branch
ActualArgument was modified in the master branch from
a struct to class. In order to compile once merged, this PR
required the related access paterns to be adapted to match
the new ActualArgument.
As a consequence, this PR does not compile anymore on its own,
it needs to be merged with the master branch to work.

Original-commit: flang-compiler/f18@48cdd2ed0e
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
8f0eb89cb6 [flang] Test cases for folding intrinsic function with runtime
Original-commit: flang-compiler/f18@92caee1def
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
167730fd91 [flang] Enable folding of some more intrinsic functions
Enable folding of the following 80 intrinsic functions:

+ Without runtime:

++ Integer:
abs, dim, dshiftl, dshiftr, exponent, iand, ibclr, ibset, ieor, int,
ior, ishft, kind, len, leadz, maskl, maskr, merge_bits, popcnt, poppar,
shifta, shiftl, shiftr, trailz

++ Real:
abs, aimag, aint, dprod, real

+ Complex:
cmplx, conjg

++ Logical:
bge, bgt, ble, blt

+ With Runtime :

+ Real:
acos, acosh, asinh, atan, atan2, atanh, bessel_j0, bessel_j1,
bessel_jn (elemental), bessel_y0, bessel_y1, bessel_yn (elemental),
cos, cosh, erf, erfc, erfc_scaled, exp, gamma, hypot, log, log10,
log_gamma, mod, sin, sqrt, sinh, sqrt, tan, tanh

++ Complex:
acos, acosh, asin, asinh, atan, atanh, cos, cosh, exp, log, sin,
sinh, sqrt, tan, tanh

Original-commit: flang-compiler/f18@7e7d1920f8
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
dc3cca3427 [flang] make HostIntrinsicProceduresLibrary a class
Original-commit: flang-compiler/f18@b9f5015d4d
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
aeb7cef41a [flang] add the possibility to use libpgmath for constant folding
Original-commit: flang-compiler/f18@948a665627
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
9147534f13 [flang] Map more intrinsic functions to <cmath> functions
Original-commit: flang-compiler/f18@f0f2062211
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
e3b74caa0d [flang] Move host floating point environment handling in host.h/host.cc
Original-commit: flang-compiler/f18@0cba8b1308
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
ca0261b253 [flang] Removed dynamic loading feature for intrinsic folding
After more reflexion, dynamic loading brings to much uncertainty
regarding which library is actually being use for folding.
It is removed to avoid pushing people to use it.
A static linking to libpgmath will be provided in a later commit.

Original-commit: flang-compiler/f18@2161627d28
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
9ce02da63a [flang] fix clang++ linking issue with libm
Original-commit: flang-compiler/f18@805c861bd0
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
8d032dc96b [flang] renaming to focus scope on intrinsic runtime
Original-commit: flang-compiler/f18@7cfd33b178
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
fa3a179fec [flang] made fenv errors internal errors
Original-commit: flang-compiler/f18@f776c8db91
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
a955f3e51c [flang] fix signed/unsigned comparison
Original-commit: flang-compiler/f18@46148712e1
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00
Jean Perier
4fdf4fa18d [flang] Limits C++ implementation behaviors
The issue addressed here is the use of cast between object pointers
and function pointers. It is implementation defined because C++,
just like C, does not mandate that function and object pointers
must have the same size.
It is needed to have such cast because it is a will to ba able to
call inside F18 numerical function from libraries linked during
a Fortran program compilation in order to perform folding.
dlopen returns function pointers as void* that need to be cast to
pointer before use.
This change limits the usage of such cast inside ifdefs where POSIX
is required. In POSIX context, such cast is defined. Dlopen is
anyway used only if the environment is POSIX compliant.
In the rest of the code, opaque function pointers have been changed
from void* to void*(*)(). reinterpret_cast from function pointer to
function pointer are standard compliant.

Original-commit: flang-compiler/f18@4b2f29a128
Tree-same-pre-rewrite: false
2019-03-27 10:16:07 -07:00