aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/io
diff options
context:
space:
mode:
authorJanne Blomqvist <jb@gcc.gnu.org>2011-11-10 19:08:24 +0200
committerJanne Blomqvist <jb@gcc.gnu.org>2011-11-10 19:08:24 +0200
commit992b0aa1cfe185d5666b5627087a830ebb93df24 (patch)
tree52a5786807d13e349cc9d6257d66fd9d3c9e3366 /libgfortran/io
parent154b68db9bee50c8acb1c0440987f4ef176d2a65 (diff)
downloadgcc-992b0aa1cfe185d5666b5627087a830ebb93df24.zip
gcc-992b0aa1cfe185d5666b5627087a830ebb93df24.tar.gz
gcc-992b0aa1cfe185d5666b5627087a830ebb93df24.tar.bz2
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. From-SVN: r181260
Diffstat (limited to 'libgfortran/io')
-rw-r--r--libgfortran/io/format.c4
-rw-r--r--libgfortran/io/io.h9
-rw-r--r--libgfortran/io/transfer.c9
-rw-r--r--libgfortran/io/write.c10
-rw-r--r--libgfortran/io/write_float.def2
5 files changed, 14 insertions, 20 deletions
diff --git a/libgfortran/io/format.c b/libgfortran/io/format.c
index 518dc80..1711a75 100644
--- a/libgfortran/io/format.c
+++ b/libgfortran/io/format.c
@@ -116,8 +116,8 @@ reset_fnode_counters (st_parameter_dt *dtp)
/* A simple hashing function to generate an index into the hash table. */
-static inline
-uint32_t format_hash (st_parameter_dt *dtp)
+static uint32_t
+format_hash (st_parameter_dt *dtp)
{
char *key;
gfc_charlen_type key_len;
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 5270fd7..06364e1 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -801,5 +801,14 @@ dec_waiting_unlocked (gfc_unit *u)
#endif
}
+
+static inline void
+memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
+{
+ int j;
+ for (j = 0; j < k; j++)
+ *p++ = c;
+}
+
#endif
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 062f80e..976102f 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -2877,7 +2877,7 @@ next_record_r_unf (st_parameter_dt *dtp, int complete_record)
}
-static inline gfc_offset
+static gfc_offset
min_off (gfc_offset a, gfc_offset b)
{
return (a < b ? a : b);
@@ -3136,13 +3136,6 @@ sset (stream * s, int c, ssize_t nbyte)
return nbyte - bytes_left;
}
-static inline void
-memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
-{
- int j;
- for (j = 0; j < k; j++)
- *p++ = c;
-}
/* Position to the next record in write mode. */
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index 95eec84..8be3a5a 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -41,15 +41,7 @@ typedef unsigned char uchar;
/* Helper functions for character(kind=4) internal units. These are needed
by write_float.def. */
-static inline void
-memset4 (gfc_char4_t *p, gfc_char4_t c, int k)
-{
- int j;
- for (j = 0; j < k; j++)
- *p++ = c;
-}
-
-static inline void
+static void
memcpy4 (gfc_char4_t *dest, const char *source, int k)
{
int j;
diff --git a/libgfortran/io/write_float.def b/libgfortran/io/write_float.def
index 7ab70d2..78f09b2 100644
--- a/libgfortran/io/write_float.def
+++ b/libgfortran/io/write_float.def
@@ -774,7 +774,7 @@ write_infnan (st_parameter_dt *dtp, const fnode *f, int isnan_flag, int sign_bit
/* Returns the value of 10**d. */
#define CALCULATE_EXP(x) \
-inline static GFC_REAL_ ## x \
+static GFC_REAL_ ## x \
calculate_exp_ ## x (int d)\
{\
int i;\