This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch committed: Don't declare externally visible functions inline
- From: Ian Lance Taylor <iant at google dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 16 Jun 2009 10:52:01 -0700
- Subject: Re: Patch committed: Don't declare externally visible functions inline
- References: <20090616165057.4304.qmail@pepe.airs.com>
Ian Lance Taylor <iant@google.com> writes:
> In C++ and C99, when a function is declared inline, it is not visible
> outside the file. In GNU89, it is visible. There are a few places
> where gcc relies on GNU89 semantics. This is undesirable for both C++
> and C99. With the current compiler heuristics, there is little
> benefit to explicitly declaring an externally visible function as
> inline. This patch removes the inline from those functions.
>
> This patch also removes a useless duplicate definition of
> sched_scan_info in haifa-sched.c.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu. Committed.
>
> Ian
>
>
> 2009-06-16 Ian Lance Taylor <iant@google.com>
>
> * bitmap.c (bitmap_clear): Don't declare as inline.
> * gimple.c (gimplify_assign): Likewise.
> * tree-ssa-sccvn.c (vn_nary_op_compute_hash): Likewise.
> * haifa-sched.c (insn_cost): Don't declare with HAIFA_INLINE.
> (sched_scan_info): Remove duplicate definition.
Really attaching the patch (I hope).
Index: bitmap.c
===================================================================
--- bitmap.c (revision 148538)
+++ bitmap.c (revision 148539)
@@ -291,7 +291,7 @@ bitmap_elt_clear_from (bitmap head, bitm
/* Clear a bitmap by freeing the linked list. */
-inline void
+void
bitmap_clear (bitmap head)
{
if (head->first)
Index: tree-ssa-sccvn.c
===================================================================
--- tree-ssa-sccvn.c (revision 148538)
+++ tree-ssa-sccvn.c (revision 148539)
@@ -1362,7 +1362,7 @@ vn_reference_insert_pieces (tree vuse, a
/* Compute and return the hash value for nary operation VBO1. */
-inline hashval_t
+hashval_t
vn_nary_op_compute_hash (const vn_nary_op_t vno1)
{
hashval_t hash = 0;
Index: haifa-sched.c
===================================================================
--- haifa-sched.c (revision 148538)
+++ haifa-sched.c (revision 148539)
@@ -601,7 +601,7 @@ static rtx last_scheduled_insn;
/* Compute cost of executing INSN.
This is the number of cycles between instruction issue and
instruction results. */
-HAIFA_INLINE int
+int
insn_cost (rtx insn)
{
int cost;
@@ -4721,8 +4721,6 @@ check_cfg (rtx head, rtx tail)
#endif /* ENABLE_CHECKING */
-const struct sched_scan_info_def *sched_scan_info;
-
/* Extend per basic block data structures. */
static void
extend_bb (void)
Index: gimple.c
===================================================================
--- gimple.c (revision 148538)
+++ gimple.c (revision 148539)
@@ -448,7 +448,7 @@ gimple_build_assign_with_ops_stat (enum
This function returns the newly created GIMPLE_ASSIGN tuple. */
-inline gimple
+gimple
gimplify_assign (tree dst, tree src, gimple_seq *seq_p)
{
tree t = build2 (MODIFY_EXPR, TREE_TYPE (dst), dst, src);