diff options
author | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-04-13 20:15:58 +0000 |
---|---|---|
committer | Thomas Koenig <tkoenig@gcc.gnu.org> | 2008-04-13 20:15:58 +0000 |
commit | c7d0f4d5fabc279dd81330ebffdf037b31420706 (patch) | |
tree | e022b93b7ac1c858cd02bc0f837fdaae49b136ff /libgfortran/intrinsics/signal.c | |
parent | 92d4508a7db153423b0572047fa6947af569d4b6 (diff) | |
download | gcc-c7d0f4d5fabc279dd81330ebffdf037b31420706.zip gcc-c7d0f4d5fabc279dd81330ebffdf037b31420706.tar.gz gcc-c7d0f4d5fabc279dd81330ebffdf037b31420706.tar.bz2 |
re PR libfortran/32972 (performance of pack/unpack)
2008-04-13 Thomas Koenig <tkoenig@gcc.gnu.org>
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/32972
PR libfortran/32512
configure.ac: Add test for uintptr_t.
configure: Regenerated.
config.h.in: Regenerated.
* libgfortran.h: GFC_DTYPE_DERIVED_1: New macro.
GFC_DTYPE_DERIVED_2: New macro.
GFC_DTYPE_DERIVED_4: New macro.
GFC_DTYPE_DERIVED_8: New macro.
GFC_DTYPE_DERIVED_16: New macro.
GFC_UNALIGNED_2: New macro.
GFC_UNALIGNED_4: New macro.
GFC_UNALIGNED_8: New macro.
GFC_UNALIGNED_16: New macro.
intptr_t: Define if we don't have it.
uintptr_t: Likewise.
* runtime/backtrace.c (show_backtrace): Use intptr_t.
* intrinsics/signal.c (signal_sub): Likewise.
(signal_sub_int): Likewise.
(alarm_sub_int_i4): Likewise.
* intrinsics/spread_generic.c (spread): Use the integer
routines for handling derived types of sizes 1, 2, 4, 8 and 16
if the alignment of all pointers is correct.
(spread_scalar): Likewise.
* intrinsics/pack_generic.c (pack): Likewise.
Use GFD_DTYPE_TYPE_SIZE to avoid nested switch statements.
* intrinsics/unpack_generic.c (unpack1): Likewise.
(unpack0): Likewise.
* runtime/in_pack_generic.c (internal_pack): Likewise.
* runtime/in_unpack_generic.c (internal_unpack): Likewise.
2008-04-13 Thomas Koenig <tkoenig@gcc.gnu.org>
PR libfortran/32972
PR libfortran/32512
* gfortran.dg/internal_pack_1.f90: Add test for derived type.
* gfortran.dg/intrinsic_spread_1.f90: Likewise.
* gfortran.dg/intrinsic_pack_1.f90: Likewise.
* gfortran.dg/intrinsic_unpack_1.f90: Likewise.
Co-Authored-By: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
From-SVN: r134245
Diffstat (limited to 'libgfortran/intrinsics/signal.c')
-rw-r--r-- | libgfortran/intrinsics/signal.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/libgfortran/intrinsics/signal.c b/libgfortran/intrinsics/signal.c index 27d6222..bd03f6d 100644 --- a/libgfortran/intrinsics/signal.c +++ b/libgfortran/intrinsics/signal.c @@ -44,12 +44,6 @@ Boston, MA 02110-1301, USA. */ #include <errno.h> -#ifdef HAVE_INTPTR_T -# define INTPTR_T intptr_t -#else -# define INTPTR_T int -#endif - /* SIGNAL subroutine with PROCEDURE as handler */ extern void signal_sub (int *, void (*)(int), int *); iexport_proto(signal_sub); @@ -58,11 +52,11 @@ void signal_sub (int *number, void (*handler)(int), int *status) { #ifdef HAVE_SIGNAL - INTPTR_T ret; + intptr_t ret; if (status != NULL) { - ret = (INTPTR_T) signal (*number, handler); + ret = (intptr_t) signal (*number, handler); *status = (int) ret; } else @@ -84,11 +78,11 @@ void signal_sub_int (int *number, int *handler, int *status) { #ifdef HAVE_SIGNAL - INTPTR_T ptr = *handler, ret; + intptr_t ptr = *handler, ret; if (status != NULL) { - ret = (INTPTR_T) signal (*number, (void (*)(int)) ptr); + ret = (intptr_t) signal (*number, (void (*)(int)) ptr); *status = (int) ret; } else @@ -204,14 +198,14 @@ alarm_sub_int_i4 (int *seconds __attribute__ ((unused)), #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL) if (status != NULL) { - if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR) + if (signal (SIGALRM, (void (*)(int)) (intptr_t) *handler) == SIG_ERR) *status = -1; else *status = alarm (*seconds); } else { - signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler); + signal (SIGALRM, (void (*)(int)) (intptr_t) *handler); alarm (*seconds); } #else @@ -234,14 +228,14 @@ alarm_sub_int_i8 (int *seconds __attribute__ ((unused)), #if defined (SIGALRM) && defined (HAVE_ALARM) && defined (HAVE_SIGNAL) if (status != NULL) { - if (signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler) == SIG_ERR) + if (signal (SIGALRM, (void (*)(int)) (intptr_t) *handler) == SIG_ERR) *status = -1; else *status = alarm (*seconds); } else { - signal (SIGALRM, (void (*)(int)) (INTPTR_T) *handler); + signal (SIGALRM, (void (*)(int)) (intptr_t) *handler); alarm (*seconds); } #else |