diff options
author | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 17:08:24 +0000 |
---|---|---|
committer | jb <jb@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-10 17:08:24 +0000 |
commit | 15aefa66eea98ad9cfdf9860acb004c18055d46f (patch) | |
tree | 52a5786807d13e349cc9d6257d66fd9d3c9e3366 /libgfortran/intrinsics | |
parent | c449f851c5fc2e2e46b98d8a22bde7571a9cedc6 (diff) | |
download | ppe42-gcc-15aefa66eea98ad9cfdf9860acb004c18055d46f.tar.gz ppe42-gcc-15aefa66eea98ad9cfdf9860acb004c18055d46f.zip |
Let the compiler decide whether to inline.
2011-11-10 Janne Blomqvist <jb@gcc.gnu.org>
* intrinsics/cpu_time.c (__cpu_time_1): Don't force inlining.
* intrinsics/random.c (rnumber_4): Remove inline attribute.
(rnumber_8, rnumber_10, rnumber_16): Likewise.
* intrinsics/system_clock.c (gf_gettime_mono): Likewise.
* intrinsics/time_1.h (ATTRIBUTE_ALWAYS_INLINE): Remove macro.
(gf_cputime): Add inline attribute for MingW version.
* io/format.c (format_hash): Remove inline attribute.
* io/io.h (memset4): Inline function from transfer.c and write.c
moved here.
* io/transfer.c (min_off): Remove inline attribute.
(memset4): Move to io.h.
* io/write.c (memset4): Likewise.
(memcpy4): Remove inline attribute.
* io/write_float.def (calculate_exp): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181260 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran/intrinsics')
-rw-r--r-- | libgfortran/intrinsics/cpu_time.c | 4 | ||||
-rw-r--r-- | libgfortran/intrinsics/random.c | 8 | ||||
-rw-r--r-- | libgfortran/intrinsics/system_clock.c | 2 | ||||
-rw-r--r-- | libgfortran/intrinsics/time_1.h | 10 |
4 files changed, 7 insertions, 17 deletions
diff --git a/libgfortran/intrinsics/cpu_time.c b/libgfortran/intrinsics/cpu_time.c index 619f8d25246..94636c41b0b 100644 --- a/libgfortran/intrinsics/cpu_time.c +++ b/libgfortran/intrinsics/cpu_time.c @@ -26,9 +26,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #include "time_1.h" -static inline void __cpu_time_1 (long *, long *) ATTRIBUTE_ALWAYS_INLINE; - -static inline void +static void __cpu_time_1 (long *sec, long *usec) { long user_sec, user_usec, system_sec, system_usec; diff --git a/libgfortran/intrinsics/random.c b/libgfortran/intrinsics/random.c index 8c16b855d1c..35576b85bda 100644 --- a/libgfortran/intrinsics/random.c +++ b/libgfortran/intrinsics/random.c @@ -74,7 +74,7 @@ static __gthread_mutex_t random_lock; correct offset. */ -static inline void +static void rnumber_4 (GFC_REAL_4 *f, GFC_UINTEGER_4 v) { GFC_UINTEGER_4 mask; @@ -89,7 +89,7 @@ rnumber_4 (GFC_REAL_4 *f, GFC_UINTEGER_4 v) *f = (GFC_REAL_4) v * GFC_REAL_4_LITERAL(0x1.p-32); } -static inline void +static void rnumber_8 (GFC_REAL_8 *f, GFC_UINTEGER_8 v) { GFC_UINTEGER_8 mask; @@ -106,7 +106,7 @@ rnumber_8 (GFC_REAL_8 *f, GFC_UINTEGER_8 v) #ifdef HAVE_GFC_REAL_10 -static inline void +static void rnumber_10 (GFC_REAL_10 *f, GFC_UINTEGER_8 v) { GFC_UINTEGER_8 mask; @@ -126,7 +126,7 @@ rnumber_10 (GFC_REAL_10 *f, GFC_UINTEGER_8 v) /* For REAL(KIND=16), we only need to mask off the lower bits. */ -static inline void +static void rnumber_16 (GFC_REAL_16 *f, GFC_UINTEGER_8 v1, GFC_UINTEGER_8 v2) { GFC_UINTEGER_8 mask; diff --git a/libgfortran/intrinsics/system_clock.c b/libgfortran/intrinsics/system_clock.c index f4bac0777b3..6385c4f0c95 100644 --- a/libgfortran/intrinsics/system_clock.c +++ b/libgfortran/intrinsics/system_clock.c @@ -75,7 +75,7 @@ static int weak_gettime (clockid_t, struct timespec *) Return value: 0 for success, -1 for error. In case of error, errno is set. */ -static inline int +static int gf_gettime_mono (time_t * secs, long * nanosecs) { int err; diff --git a/libgfortran/intrinsics/time_1.h b/libgfortran/intrinsics/time_1.h index 327f7cf4e0e..aaca56ac54a 100644 --- a/libgfortran/intrinsics/time_1.h +++ b/libgfortran/intrinsics/time_1.h @@ -97,14 +97,6 @@ localtime_r (const time_t * timep, struct tm * result) #endif -#if defined (__GNUC__) && (__GNUC__ >= 3) -# define ATTRIBUTE_ALWAYS_INLINE __attribute__ ((__always_inline__)) -#else -# define ATTRIBUTE_ALWAYS_INLINE -#endif - -static inline int gf_cputime (long *, long *, long *, long *) ATTRIBUTE_ALWAYS_INLINE; - /* Helper function for the actual implementation of the DTIME, ETIME and CPU_TIME intrinsics. Returns 0 for success or -1 if no CPU time could be computed. */ @@ -114,7 +106,7 @@ static inline int gf_cputime (long *, long *, long *, long *) ATTRIBUTE_ALWAYS_I #define WIN32_LEAN_AND_MEAN #include <windows.h> -static int +static inline int gf_cputime (long *user_sec, long *user_usec, long *system_sec, long *system_usec) { union { |