diff mbox series

Make shift argument to eoshift0 be of type index_type

Message ID 1511350460-13820-1-git-send-email-blomqvist.janne@gmail.com
State New
Headers show
Series Make shift argument to eoshift0 be of type index_type | expand

Commit Message

Janne Blomqvist Nov. 22, 2017, 11:34 a.m. UTC
Regtested on x86_64-pc-linux-gnu, Ok for trunk?

libgfortran/ChangeLog:

2017-11-22  Janne Blomqvist  <jb@gcc.gnu.org>

	* intrinsics/eoshift0.c (eoshift0): Make shift an index_type.
---
 libgfortran/intrinsics/eoshift0.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Thomas Koenig Nov. 22, 2017, 6:03 p.m. UTC | #1
Hi Janne,

> Regtested on x86_64-pc-linux-gnu, Ok for trunk?
> 
> libgfortran/ChangeLog:
> 
> 2017-11-22  Janne Blomqvist<jb@gcc.gnu.org>
> 
> 	* intrinsics/eoshift0.c (eoshift0): Make shift an index_type.

Looks good in principle. Is it possible to come up with a test case?
This might not be executable on all systems, but it is still worth
trying to run at least once.

Regards

	Thomas
Janne Blomqvist Nov. 22, 2017, 8:06 p.m. UTC | #2
On Wed, Nov 22, 2017 at 8:03 PM, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Hi Janne,
>
>> Regtested on x86_64-pc-linux-gnu, Ok for trunk?
>>
>> libgfortran/ChangeLog:
>>
>> 2017-11-22  Janne Blomqvist<jb@gcc.gnu.org>
>>
>>         * intrinsics/eoshift0.c (eoshift0): Make shift an index_type.
>
>
> Looks good in principle. Is it possible to come up with a test case?
> This might not be executable on all systems, but it is still worth
> trying to run at least once.

I just mailed out an updated patch with a testcase in the commit msg.
I also noticed that eoshift2 suffers from the same issue, so I added a
fix for that to the patch as well (though the testcase only exercises
eoshift0).

Is that better? Ok for trunk?
Thomas Koenig Nov. 22, 2017, 8:25 p.m. UTC | #3
Am 22.11.2017 um 21:06 schrieb Janne Blomqvist:
> Is that better? Ok for trunk?

Yes, OK.

Thanks a lot for the patch!

Regards

	Thomas
Janne Blomqvist Nov. 22, 2017, 8:43 p.m. UTC | #4
On Wed, Nov 22, 2017 at 10:25 PM, Thomas Koenig <tkoenig@netcologne.de> wrote:
> Am 22.11.2017 um 21:06 schrieb Janne Blomqvist:
>>
>> Is that better? Ok for trunk?
>
>
> Yes, OK.
>
> Thanks a lot for the patch!

Thanks, committed as r255077!
diff mbox series

Patch

diff --git a/libgfortran/intrinsics/eoshift0.c b/libgfortran/intrinsics/eoshift0.c
index 3dae88c..dd8c81d 100644
--- a/libgfortran/intrinsics/eoshift0.c
+++ b/libgfortran/intrinsics/eoshift0.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
 eoshift0 (gfc_array_char * ret, const gfc_array_char * array,
-	  int shift, const char * pbound, int which, index_type size,
+	  index_type shift, const char * pbound, int which, index_type size,
 	  const char *filler, index_type filler_len)
 {
   /* r.* indicates the return array.  */