diff options
author | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-07-23 21:43:21 +0000 |
---|---|---|
committer | Steven G. Kargl <kargl@gcc.gnu.org> | 2019-07-23 21:43:21 +0000 |
commit | 8dc63166e0b859546ba53093c5fc6c09925210dd (patch) | |
tree | d8cd9da5b8bca4b00b103577f9637fb996d8024a /libgomp | |
parent | 000a002072d04d70bcd1d4be0daf8838035afa23 (diff) | |
download | gcc-8dc63166e0b859546ba53093c5fc6c09925210dd.zip gcc-8dc63166e0b859546ba53093c5fc6c09925210dd.tar.gz gcc-8dc63166e0b859546ba53093c5fc6c09925210dd.tar.bz2 |
arith.c (gfc_convert_integer, [...]): Move to ...
2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org>
* arith.c (gfc_convert_integer, gfc_convert_real, gfc_convert_complex):
Move to ...
* primary.c (convert_integer, convert_real, convert_complex): ... here.
Rename and make static functions.
(match_integer_constant): Use convert_integer
(match_real_constant): Use convert_real.
(match_complex_constant: Use convert_complex.
* arith.h (gfc_convert_integer, gfc_convert_real, gfc_convert_complex):
Remove prototypes.
* array.c (match_array_cons_element): A BOZ cannot be a data
statement value. Jump to a common exit point.
* check.c (gfc_invalid_boz): New function. Emit error or warning
for a BOZ in an invalid context.
(boz_args_check): Move to top of file to prevent need of forward
declaration.
(is_boz_constant): New function. Check that BOZ expr is constant.
(gfc_b z2real): New function. In-place conversion of BOZ literal
constant to REAL in accordance to F2018.
(gfc_boz2int): New function. In-place conversion of BOZ literal
onstant to INTEGER in accordance to F2018.
(gfc_check_achar, gfc_check_char, gfc_check_float): Use gfc_invalid_boz.
Convert BOZ as needed.
(gfc_check_bge_bgt_ble_blt): Enforce F2018 requirements on BGE,
BGT, BLE, and BLT intrinsic functions.
(gfc_check_cmplx): Re-organize to check kind, if present, first.
Convert BOZ real and/or imaginary parts as needed in accordance to
F2018.
(gfc_check_complex): Use gfc_invalid_boz. Convert BOZ as needed.
(gfc_check_dcmplx, gfc_check_dble ): Convert BOZ as needed.
(gfc_check_dshift): Make dshift[lr] conform to F2018 standard.
gfc_check_float (gfc_expr *a)
(gfc_check_iand_ieor_ior): Make IAND, IEOR, and IOR conform to
F2018 standard.
(gfc_check_int): Conform to F2018 standard.
(gfc_check_intconv): Deprecate SHORT and LONG aliases for INT2 and
INT. Simply return for a BOZ argument. See gfc_simplify_intconv.
(gfc_check_merge_bits): Make MERGE_BITS conform to Fortran 2018
standard.
(gfc_check_real): Remove incorrect comment. Check kind, if present,
first. Simply return for a BOZ argument. See gfc_simplify_real.
(gfc_check_and): Re-do error handling for BOZ arguments. Remove
special casing ts.type != BT_INTEGER or BT_LOGICAL.
* decl.c (match_old_style_init): Check for BOZ in old-style
initialization. Issue error or warning depending on
-fallow-invalid-boz option. Issue error if variable is not an
INTEGER or REAL and the value is BOZ.
* expr.c (gfc_copy_expr): Copy a BT_BOZ gfc_expr.
(gfc_check_assign): Re-do error handling for a BOZ in an assignment
statement. Do in-place conversion of RHS based on LHS type of
INTEGER or REAL.
* gfortran.h (gfc_expr): Add a boz component. Remove is_boz component.
(gfc_boz2int, gfc_boz2real, gfc_invalid_boz): New prototypes.
* interface.c (gfc_extend_assign): Guard against replacing an
intrinsic involving a BOZ literal constant on RHS.
* invoke.texi: Doument -fallow-invalid-boz.
* lang.opt: New option. -fallow-invalid-boz.
* libgfortran.h (bt): Elevate BOZ to a basic type.
* misc.c (gfc_basic_typename, gfc_typename): Translate BT_BOZ to BOZ.
* primary.c (convert_integer, convert_real, convert_complex): to here.
Rename and make static functions.
* primary.c(match_boz_constant): Rewrite parsing of a BOZ. Re-do
error handling. Deprecate 'X' for hexidecimal and postfix notation.
Use -fallow-invalid-boz and gfc_invalid_boz to accept deprecated code.
* resolve.c (resolve_ordinary_assign): Rework a RHS that is a
BOZ literal constant. Use gfc_invalid_boz to allow previous
nonstandard behavior. Remove range checking of BOZ conversion.
* simplify.c (convert_boz): Remove function.
(simplify_cmplx): Remove conversion of BOZ constants, because
conversion is done in gfc_check_cmplx.
(gfc_simplify_float): Remove conversion of BOZ constant, because
conversion is done in gfc_check_float.
(simplify_intconv): Use gfc_boz2int to convert BOZ to INTEGER.
Remove range checking for BOZ conversion.
(gfc_simplify_real): Use k, if present, to determine kind. Convert
BOZ to REAL. Remove range checking for BOZ conversion.
target-memory.c (gfc_convert_boz): Rewrite to deal with convert of
a BOZ to a REAL value.
2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org>
* gfortran.dg/achar_5.f90: Fix for new BOZ handling.
* arithmetic_overflow_1.f90: Ditto.
* gfortran.dg/boz_11.f90: Ditto.
* gfortran.dg/boz_12.f90: Ditto.
* gfortran.dg/boz_4.f90: Ditto.
* gfortran.dg/boz_5.f90: Ditto.
* gfortran.dg/boz_6.f90: Ditto.
* gfortran.dg/boz_7.f90: Ditto.
* gfortran.dg/boz_8.f90: Ditto.
* gfortran.dg/dec_structure_6.f90: Ditto.
* gfortran.dg/dec_union_1.f90: Ditto.
* gfortran.dg/dec_union_2.f90: Ditto.
* gfortran.dg/dec_union_5.f90: Ditto.
* gfortran.dg/dshift_3.f90: Ditto.
* gfortran.dg/gnu_logical_2.f90: Ditto.
* gfortran.dg/int_conv_1.f90: Ditto.
* gfortran.dg/ishft_1.f90: Ditto.
* gfortran.dg/nan_4.f90: Ditto.
* gfortran.dg/no_range_check_3.f90: Ditto.
* gfortran.dg/pr16433.f: Ditto.
* gfortran.dg/pr44491.f90: Ditto.
* gfortran.dg/pr58027.f90: Ditto.
* gfortran.dg/pr81509_2.f90: Ditto.
* gfortran.dg/unf_io_convert_1.f90: Ditto.
* gfortran.dg/unf_io_convert_2.f90: Ditto.
* gfortran.fortran-torture/execute/intrinsic_fraction_exponent.f90:
Ditto.
* gfortran.fortran-torture/execute/intrinsic_mvbits.f90: Ditto.
* gfortran.fortran-torture/execute/intrinsic_nearest.f90: Ditto.
* gfortran.fortran-torture/execute/seq_io.f90: Ditto.
* gfortran.dg/gnu_logical_1.F: Delete test.
* gfortran.dg/merge_bits_3.f90: New test.
* gfortran.dg/merge_bits_3.f90: Ditto.
* gfortran.dg/boz_int.f90: Ditto.
* gfortran.dg/boz_bge.f90: Ditto.
* gfortran.dg/boz_complex_1.f90: Ditto.
* gfortran.dg/boz_complex_2.f90: Ditto.
* gfortran.dg/boz_complex_3.f90: Ditto.
* gfortran.dg/boz_dble.f90: Ditto.
* gfortran.dg/boz_dshift_1.f90: Ditto.
* gfortran.dg/boz_dshift_2.f90: Ditto.
* gfortran.dg/boz_float_1.f90: Ditto.
* gfortran.dg/boz_float_2.f90: Ditto.
* gfortran.dg/boz_float_3.f90: Ditto.
* gfortran.dg/boz_iand_1.f90: Ditto.
* gfortran.dg/boz_iand_2.f90: Ditto.
2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org>
* testsuite/libgomp.fortran/reduction4.f90: Update BOZ usage
* testsuite/libgomp.fortran/reduction5.f90: Ditto.
From-SVN: r273747
Diffstat (limited to 'libgomp')
-rw-r--r-- | libgomp/ChangeLog | 5 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/reduction4.f90 | 56 | ||||
-rw-r--r-- | libgomp/testsuite/libgomp.fortran/reduction5.f90 | 10 |
3 files changed, 38 insertions, 33 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog index 547ce4e..8590047 100644 --- a/libgomp/ChangeLog +++ b/libgomp/ChangeLog @@ -1,3 +1,8 @@ +2019-07-23 Steven G. Kargl <kargl@gcc.gnu.org> + + * testsuite/libgomp.fortran/reduction4.f90: Update BOZ usage + * testsuite/libgomp.fortran/reduction5.f90: Ditto. + 2019-07-20 Jakub Jelinek <jakub@redhat.com> * testsuite/libgomp.c-c++-common/loop-1.c: New test. diff --git a/libgomp/testsuite/libgomp.fortran/reduction4.f90 b/libgomp/testsuite/libgomp.fortran/reduction4.f90 index 91c7fc8..498d546 100644 --- a/libgomp/testsuite/libgomp.fortran/reduction4.f90 +++ b/libgomp/testsuite/libgomp.fortran/reduction4.f90 @@ -4,12 +4,12 @@ integer (kind = 4) :: i, ia (6), j, ja (6), k, ka (6), ta (6), n, cnt, x logical :: v - i = Z'ffff0f' - ia = Z'f0ff0f' - j = Z'0f0000' - ja = Z'0f5a00' - k = Z'055aa0' - ka = Z'05a5a5' + i = int(Z'ffff0f') + ia = int(Z'f0ff0f') + j = int(Z'0f0000') + ja = int(Z'0f5a00') + k = int(Z'055aa0') + ka = int(Z'05a5a5') v = .false. cnt = -1 x = not(0) @@ -22,35 +22,35 @@ n = omp_get_thread_num () if (n .eq. 0) then cnt = omp_get_num_threads () - i = Z'ff7fff' - ia(3:5) = Z'fffff1' - j = Z'078000' + i = int(Z'ff7fff') + ia(3:5) = int(Z'fffff1') + j = int(Z'078000') ja(1:3) = 1 - k = Z'78' - ka(3:6) = Z'f0f' + k = int(Z'78') + ka(3:6) = int(Z'f0f') else if (n .eq. 1) then - i = Z'ffff77' - ia(2:5) = Z'ffafff' - j = Z'007800' + i = int(Z'ffff77') + ia(2:5) = int(Z'ffafff') + j = int(Z'007800') ja(2:5) = 8 - k = Z'57' - ka(3:4) = Z'f0108' + k = int(Z'57') + ka(3:4) = int(Z'f0108') else - i = Z'777fff' - ia(1:2) = Z'fffff3' - j = Z'000780' - ja(5:6) = Z'f00' - k = Z'1000' - ka(6:6) = Z'777' + i = int(Z'777fff') + ia(1:2) = int(Z'fffff3') + j = int(Z'000780') + ja(5:6) = int(Z'f00') + k = int(Z'1000') + ka(6:6) = int(Z'777') end if !$omp end parallel if (v) STOP 1 if (cnt .eq. 3) then - ta = (/Z'f0ff03', Z'f0af03', Z'f0af01', Z'f0af01', Z'f0af01', Z'f0ff0f'/) - if (i .ne. Z'777f07' .or. any (ia .ne. ta)) STOP 2 - ta = (/Z'f5a01', Z'f5a09', Z'f5a09', Z'f5a08', Z'f5f08', Z'f5f00'/) - if (j .ne. Z'fff80' .or. any (ja .ne. ta)) STOP 3 - ta = (/Z'5a5a5', Z'5a5a5', Z'aaba2', Z'aaba2', Z'5aaaa', Z'5addd'/) - if (k .ne. Z'54a8f' .or. any (ka .ne. ta)) STOP 4 + ta = (/int(Z'f0ff03'), int(Z'f0af03'), int(Z'f0af01'), int(Z'f0af01'), int(Z'f0af01'), int(Z'f0ff0f')/) + if (i .ne. int(Z'777f07') .or. any (ia .ne. ta)) STOP 2 + ta = (/int(Z'f5a01'), int(Z'f5a09'), int(Z'f5a09'), int(Z'f5a08'), int(Z'f5f08'), int(Z'f5f00')/) + if (j .ne. int(Z'fff80') .or. any (ja .ne. ta)) STOP 3 + ta = (/int(Z'5a5a5'), int(Z'5a5a5'), int(Z'aaba2'), int(Z'aaba2'), int(Z'5aaaa'), int(Z'5addd')/) + if (k .ne. int(Z'54a8f') .or. any (ka .ne. ta)) STOP 4 end if end diff --git a/libgomp/testsuite/libgomp.fortran/reduction5.f90 b/libgomp/testsuite/libgomp.fortran/reduction5.f90 index f8fdcb4..a1d1a8e 100644 --- a/libgomp/testsuite/libgomp.fortran/reduction5.f90 +++ b/libgomp/testsuite/libgomp.fortran/reduction5.f90 @@ -10,15 +10,15 @@ contains subroutine test1 use reduction5, bitwise_or => ior integer :: n - n = Z'f' + n = int(Z'f') !$omp parallel sections num_threads (3) reduction (bitwise_or: n) - n = ior (n, Z'20') + n = ior (n, int(Z'20')) !$omp section - n = bitwise_or (Z'410', n) + n = bitwise_or (int(Z'410'), n) !$omp section - n = bitwise_or (n, Z'2000') + n = bitwise_or (n, int(Z'2000')) !$omp end parallel sections - if (n .ne. Z'243f') STOP 1 + if (n .ne. int(Z'243f')) STOP 1 end subroutine subroutine test2 use reduction5, min => max, max => min |