diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2017-11-22 22:42:39 +0200 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2017-11-22 22:42:39 +0200 |
commit | a97ae55991e4849f162a61bbf980009d549107e7 (patch) | |
tree | 63c0592974232e6ab2c30f747bf0f95b29215ae2 /libgfortran/intrinsics/eoshift2.c | |
parent | ce95abc41e998c8d1e1b2112a634d5a6cdd9ede0 (diff) | |
download | gcc-a97ae55991e4849f162a61bbf980009d549107e7.zip gcc-a97ae55991e4849f162a61bbf980009d549107e7.tar.gz gcc-a97ae55991e4849f162a61bbf980009d549107e7.tar.bz2 |
Make shift argument to eoshift0 and eoshift2 be of type index_type
Test case that requires 4 GB RAM that exercises eoshift0:
program main
implicit none
integer(1) :: line(2_8**31+10)
line = 42
line = eoshift(line, 2_8**31+7)
print *, line(1:4)
print *, line((ubound(line, 1, kind=8)-4):ubound(line, 1, kind=8))
end program main
Before patch:
❯ ./a.out
0 0 0 0
42 42 42 42 42
With patch:
❯ ./a.out
42 42 42 0
0 0 0 0 0
Regtested on x86_64-pc-linux-gnu.
libgfortran/ChangeLog:
2017-11-22 Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/eoshift0.c (eoshift0): Make shift an index_type.
* intrinsics/eoshift2.c (eoshift2): Make shift an index_type.
From-SVN: r255077
Diffstat (limited to 'libgfortran/intrinsics/eoshift2.c')
-rw-r--r-- | libgfortran/intrinsics/eoshift2.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/libgfortran/intrinsics/eoshift2.c b/libgfortran/intrinsics/eoshift2.c index 5d949dd..ab760f7 100644 --- a/libgfortran/intrinsics/eoshift2.c +++ b/libgfortran/intrinsics/eoshift2.c @@ -26,12 +26,10 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "libgfortran.h" #include <string.h> -/* TODO: make this work for large shifts when - sizeof(int) < sizeof (index_type). */ static void eoshift2 (gfc_array_char *ret, const gfc_array_char *array, - int shift, const gfc_array_char *bound, int which, + index_type shift, const gfc_array_char *bound, int which, const char *filler, index_type filler_len) { /* r.* indicates the return array. */ |