diff options
Diffstat (limited to 'libgfortran/intrinsics/cshift0.c')
-rw-r--r-- | libgfortran/intrinsics/cshift0.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/libgfortran/intrinsics/cshift0.c b/libgfortran/intrinsics/cshift0.c index 026dd1adc0d..5da73d4e170 100644 --- a/libgfortran/intrinsics/cshift0.c +++ b/libgfortran/intrinsics/cshift0.c @@ -1,5 +1,5 @@ /* Generic implementation of the CSHIFT intrinsic - Copyright 2003, 2005, 2006, 2007, 2010 Free Software Foundation, Inc. + Copyright 2003, 2005, 2006, 2007, 2010, 2012 Free Software Foundation, Inc. Contributed by Feng Wang <wf_cs@yahoo.com> This file is part of the GNU Fortran runtime library (libgfortran). @@ -58,7 +58,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, arraysize = size0 ((array_t *) array); - if (ret->data == NULL) + if (ret->base_addr == NULL) { int i; @@ -80,7 +80,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, } /* internal_malloc_size allocates a single byte for zero size. */ - ret->data = internal_malloc_size (size * arraysize); + ret->base_addr = internal_malloc_size (size * arraysize); } else if (unlikely (compile_options.bounds_check)) { @@ -199,7 +199,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, break; case sizeof (GFC_INTEGER_2): - if (GFC_UNALIGNED_2(ret->data) || GFC_UNALIGNED_2(array->data)) + if (GFC_UNALIGNED_2(ret->base_addr) || GFC_UNALIGNED_2(array->base_addr)) break; else { @@ -209,7 +209,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, } case sizeof (GFC_INTEGER_4): - if (GFC_UNALIGNED_4(ret->data) || GFC_UNALIGNED_4(array->data)) + if (GFC_UNALIGNED_4(ret->base_addr) || GFC_UNALIGNED_4(array->base_addr)) break; else { @@ -219,7 +219,7 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, } case sizeof (GFC_INTEGER_8): - if (GFC_UNALIGNED_8(ret->data) || GFC_UNALIGNED_8(array->data)) + if (GFC_UNALIGNED_8(ret->base_addr) || GFC_UNALIGNED_8(array->base_addr)) { /* Let's try to use the complex routines. First, a sanity check that the sizes match; this should be optimized to @@ -227,7 +227,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, if (sizeof(GFC_INTEGER_8) != sizeof(GFC_COMPLEX_4)) break; - if (GFC_UNALIGNED_C4(ret->data) || GFC_UNALIGNED_C4(array->data)) + if (GFC_UNALIGNED_C4(ret->base_addr) + || GFC_UNALIGNED_C4(array->base_addr)) break; cshift0_c4 ((gfc_array_c4 *) ret, (gfc_array_c4 *) array, shift, @@ -243,7 +244,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, #ifdef HAVE_GFC_INTEGER_16 case sizeof (GFC_INTEGER_16): - if (GFC_UNALIGNED_16(ret->data) || GFC_UNALIGNED_16(array->data)) + if (GFC_UNALIGNED_16(ret->base_addr) + || GFC_UNALIGNED_16(array->base_addr)) { /* Let's try to use the complex routines. First, a sanity check that the sizes match; this should be optimized to @@ -251,7 +253,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, if (sizeof(GFC_INTEGER_16) != sizeof(GFC_COMPLEX_8)) break; - if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data)) + if (GFC_UNALIGNED_C8(ret->base_addr) + || GFC_UNALIGNED_C8(array->base_addr)) break; cshift0_c8 ((gfc_array_c8 *) ret, (gfc_array_c8 *) array, shift, @@ -267,7 +270,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, #else case sizeof (GFC_COMPLEX_8): - if (GFC_UNALIGNED_C8(ret->data) || GFC_UNALIGNED_C8(array->data)) + if (GFC_UNALIGNED_C8(ret->base_addr) + || GFC_UNALIGNED_C8(array->base_addr)) break; else { @@ -323,8 +327,8 @@ cshift0 (gfc_array_char * ret, const gfc_array_char * array, dim = GFC_DESCRIPTOR_RANK (array); rstride0 = rstride[0]; sstride0 = sstride[0]; - rptr = ret->data; - sptr = array->data; + rptr = ret->base_addr; + sptr = array->base_addr; shift = len == 0 ? 0 : shift % (ptrdiff_t)len; if (shift < 0) |