Do array index calculations in gfc_array_index_type

It was recently noticed that for a few of the coarray intrinsics array
index calculations were done in integer_type_node instead of
gfc_array_index_type.  This patch fixes this.

Regtested on x86_64-pc-linux-gnu.

gcc/fortran/ChangeLog:

2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>

	* trans-expr.c (gfc_caf_get_image_index): Do array index
	calculations in gfc_array_index_type.
	* trans-intrinsic.c (conv_intrinsic_event_query): Likewise.
	* trans-stmt.c (gfc_trans_lock_unlock): Likewise.
	(gfc_trans_event_post_wait): Likewise.

gcc/testsuite/ChangeLog:

2018-09-23  Janne Blomqvist  <jb@gcc.gnu.org>

	* gfortran.dg/coarray_lib_alloc_4.f90: Fix scan patterns.
	* gfortran.dg/coarray_lock_7.f90: Likewise.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@264513 138bc75d-0d04-0410-961f-82ee72b054a4
7 files changed