Make shift argument to eoshift0 and eoshift2 be of type index_type
commit36fec693ee87653b512e1a9c044ab928a1c264b1
authorjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Nov 2017 20:42:39 +0000 (22 20:42 +0000)
committerjb <jb@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 22 Nov 2017 20:42:39 +0000 (22 20:42 +0000)
tree63c0592974232e6ab2c30f747bf0f95b29215ae2
parent8e4391a571929f868232b444bb5d48b612591dfd
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@255077 138bc75d-0d04-0410-961f-82ee72b054a4
libgfortran/ChangeLog
libgfortran/intrinsics/eoshift0.c
libgfortran/intrinsics/eoshift2.c