aboutsummaryrefslogtreecommitdiff
path: root/gcc/calls.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2007-06-30 12:56:43 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2007-06-30 12:56:43 +0000
commitad960f56f2e381290d1a83b0ee2f1d7b0e9d3a97 (patch)
tree6cf59c10b1848193cc5f27b945729e4c00add85d /gcc/calls.c
parenta4fbe84bd2ae7c5cacbada14abe4d3b9a7bbe6d0 (diff)
downloadgcc-ad960f56f2e381290d1a83b0ee2f1d7b0e9d3a97.zip
gcc-ad960f56f2e381290d1a83b0ee2f1d7b0e9d3a97.tar.gz
gcc-ad960f56f2e381290d1a83b0ee2f1d7b0e9d3a97.tar.bz2
re PR c/4076 (-Wunused doesn't warn about static function only called by itself.)
2007-06-30 Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c/4076 * c-typeck.c (build_external_ref): Don't mark as used if called from itself. * calls.c (rtx_for_function_call): Likewise. testsuite/ * gcc.dg/Wunused-function.c: New. From-SVN: r126144
Diffstat (limited to 'gcc/calls.c')
-rw-r--r--gcc/calls.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/calls.c b/gcc/calls.c
index 868edfc..aa63755 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -1493,7 +1493,7 @@ rtx_for_function_call (tree fndecl, tree addr)
{
/* If this is the first use of the function, see if we need to
make an external definition for it. */
- if (! TREE_USED (fndecl))
+ if (!TREE_USED (fndecl) && fndecl != current_function_decl)
{
assemble_external (fndecl);
TREE_USED (fndecl) = 1;