]> git.ipfire.org Git - thirdparty/gcc.git/commit
Add random numbers and fix some bugs.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 24 Sep 2024 20:57:42 +0000 (22:57 +0200)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Tue, 24 Sep 2024 20:57:42 +0000 (22:57 +0200)
commit291e20e86090e5940e2bd862ec83c7d5e0715dd5
tree0b970817fd91a79f75b59b6befede665a69b910e
parentfbeb1a965d85492e2f6f3adf913b90d005151b00
Add random numbers and fix some bugs.

This patch adds random number support for UNSIGNED, plus fixes
two bugs, with array I/O where the type used to be set to BT_INTEGER,
and for division with the divisor being a constant.

gcc/fortran/ChangeLog:

* check.cc (gfc_check_random_number): Adjust for unsigned.
* iresolve.cc (gfc_resolve_random_number): Handle unsigned.
* trans-expr.cc (gfc_conv_expr_op): Handle BT_UNSIGNED for divide.
* trans-types.cc (gfc_get_dtype_rank_type): Handle BT_UNSIGNED.
* gfortran.texi: Add RANDOM_NUMBER for UNSIGNED.

libgfortran/ChangeLog:

* gfortran.map: Add _gfortran_random_m1, _gfortran_random_m2,
_gfortran_random_m4, _gfortran_random_m8 and _gfortran_random_m16.
* intrinsics/random.c (random_m1): New function.
(random_m2): New function.
(random_m4): New function.
(random_m8): New function.
(random_m16): New function.
(arandom_m1): New function.
(arandom_m2): New function.
(arandom_m4): New function.
(arandom_m8): New funciton.
(arandom_m16): New function.

gcc/testsuite/ChangeLog:

* gfortran.dg/unsigned_30.f90: New test.
gcc/fortran/check.cc
gcc/fortran/gfortran.texi
gcc/fortran/iresolve.cc
gcc/fortran/trans-expr.cc
gcc/fortran/trans-types.cc
gcc/testsuite/gfortran.dg/unsigned_30.f90 [new file with mode: 0644]
libgfortran/gfortran.map
libgfortran/intrinsics/random.c