This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
coverage.c symbols patch
- From: Kean Johnston <jkj at sco dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 30 Nov 2005 10:53:34 -0800
- Subject: coverage.c symbols patch
- Reply-to: jkj at sco dot com
All,
Attached is a patch to coverage.c that uses a correctly prefixed
symbol name instead of an internal lable, as some assemblers will
not create symbol table entries for local lables, which breaks
the compile if coverage analysis is being done.
Kean
2005-11-30 Kean Johnston <jkj@sco.com>
* coverage.c (create_coverage): Use a label prefixed with __gcov
instead of a simple ASM_GENERATE_INTERNAL_LABEL which creates only
local labels, which a pedantic assembler will not create a symbol
for.
Index: coverage.c
===================================================================
--- coverage.c (revision 107723)
+++ coverage.c (working copy)
@@ -44,6 +44,7 @@
#include "hashtab.h"
#include "tree-iterator.h"
#include "cgraph.h"
+#include "tree-gimple.h"
#include "gcov-io.c"
@@ -905,7 +906,6 @@
create_coverage (void)
{
tree gcov_info, gcov_init, body, t;
- char name_buf[32];
no_coverage = 1; /* Disable any further coverage. */
@@ -916,8 +916,7 @@
gcov_info = build_decl (VAR_DECL, NULL_TREE, TREE_TYPE (t));
TREE_STATIC (gcov_info) = 1;
- ASM_GENERATE_INTERNAL_LABEL (name_buf, "LPBX", 0);
- DECL_NAME (gcov_info) = get_identifier (name_buf);
+ DECL_NAME (gcov_info) = create_tmp_var_name ("__gcov.LPBX");
DECL_INITIAL (gcov_info) = t;
/* Build structure. */