public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [lto] use DECL_ASSEMBLER_NAME to compute section names
@ 2008-04-15 23:16 Ollie Wild
  2008-04-16  5:23 ` Kenneth Zadeck
  2008-04-16  8:08 ` Diego Novillo
  0 siblings, 2 replies; 3+ messages in thread
From: Ollie Wild @ 2008-04-15 23:16 UTC (permalink / raw)
  To: GCC Patches; +Cc: Diego Novillo, Bill Maddox

[-- Attachment #1: Type: text/plain, Size: 535 bytes --]

In lto_materialize_function(), DECL_NAME was being used to compute the
section names of functions.  However, this is incorrect for C++ (and
other languages where the name is mangled).  This patch replaces it
with DECL_ASSEMBLER_NAME.

Tested with a C/C++ bootstrap, C dg-torture testing, and manual C++
testing (The C++ dg-torture tests require one more patch.) on
i686-pc-linux-gnu.

Ollie

2008-04-15  Ollie Wild  <aaw@google.com>

        * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
        section name.

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Use-DECL_ASSEMBLER_NAME-to-compute-the-section-name.patch --]
[-- Type: text/x-patch; name=0002-Use-DECL_ASSEMBLER_NAME-to-compute-the-section-name.patch, Size: 1055 bytes --]

From 91554e5ceba5685bbb21f0a8010904d4ed295a5a Mon Sep 17 00:00:00 2001
From: Ollie Wild <aaw@google.com>
Date: Mon, 14 Apr 2008 21:54:01 -0700
Subject: [PATCH] Use DECL_ASSEMBLER_NAME to compute the section name.

	gcc/lto/
	* lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
	section name.
---
 gcc/lto/lto.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
index c882a9a..92df339 100644
--- a/gcc/lto/lto.c
+++ b/gcc/lto/lto.c
@@ -2438,11 +2438,11 @@ lto_materialize_function (struct cgraph_node *node)
 {
   tree decl = node->decl;
   struct lto_file_decl_data *file_data = node->local.lto_file_data;
-  const char *data = lto_get_section_data (file_data, 
-					   LTO_section_function_body, 
-					   IDENTIFIER_POINTER (DECL_NAME (decl)));
+  const char *data;
   tree step;
 
+  data = lto_get_section_data (file_data, LTO_section_function_body, 
+			       IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
   if (data)
     {
       struct function *fn;
-- 
1.5.3.7


^ permalink raw reply	[flat|nested] 3+ messages in thread

* re: [lto] use DECL_ASSEMBLER_NAME to compute section names
  2008-04-15 23:16 [lto] use DECL_ASSEMBLER_NAME to compute section names Ollie Wild
@ 2008-04-16  5:23 ` Kenneth Zadeck
  2008-04-16  8:08 ` Diego Novillo
  1 sibling, 0 replies; 3+ messages in thread
From: Kenneth Zadeck @ 2008-04-16  5:23 UTC (permalink / raw)
  To: gcc-patches, aaw

> In lto_materialize_function(), DECL_NAME was being used to compute the
> section names of functions.  However, this is incorrect for C++ (and
> other languages where the name is mangled).  This patch replaces it
> with DECL_ASSEMBLER_NAME.
> 
> Tested with a C/C++ bootstrap, C dg-torture testing, and manual C++
> testing (The C++ dg-torture tests require one more patch.) on
> i686-pc-linux-gnu.
> 
> Ollie
> 
> 2008-04-15  Ollie Wild  <aaw@google.com>
> 
>         * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
>         section name.
> 
> From 91554e5ceba5685bbb21f0a8010904d4ed295a5a Mon Sep 17 00:00:00 2001
> From: Ollie Wild <aaw@google.com>
> Date: Mon, 14 Apr 2008 21:54:01 -0700
> Subject: [PATCH] Use DECL_ASSEMBLER_NAME to compute the section name.
> 
> 	gcc/lto/
> 	* lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
> 	section name.
> ---
>  gcc/lto/lto.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c
> index c882a9a..92df339 100644
> --- a/gcc/lto/lto.c
> +++ b/gcc/lto/lto.c
> @@ -2438,11 +2438,11 @@ lto_materialize_function (struct cgraph_node *node)
>  {
>    tree decl = node->decl;
>    struct lto_file_decl_data *file_data = node->local.lto_file_data;
> -  const char *data = lto_get_section_data (file_data, 
> -					   LTO_section_function_body, 
> -					   IDENTIFIER_POINTER (DECL_NAME (decl)));
> +  const char *data;
>    tree step;
>  
> +  data = lto_get_section_data (file_data, LTO_section_function_body, 
> +			       IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
>    if (data)
>      {
>        struct function *fn;
> -- 
> 1.5.3.7

this is fine

kenny

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [lto] use DECL_ASSEMBLER_NAME to compute section names
  2008-04-15 23:16 [lto] use DECL_ASSEMBLER_NAME to compute section names Ollie Wild
  2008-04-16  5:23 ` Kenneth Zadeck
@ 2008-04-16  8:08 ` Diego Novillo
  1 sibling, 0 replies; 3+ messages in thread
From: Diego Novillo @ 2008-04-16  8:08 UTC (permalink / raw)
  To: Ollie Wild; +Cc: GCC Patches, Bill Maddox

On 4/15/08 2:42 PM, Ollie Wild wrote:

> 2008-04-15  Ollie Wild  <aaw@google.com>
> 
>         * lto.c (lto_materialize_function): Use DECL_ASSEMBLER_NAME to compute
>         section name.
> 

OK.


Diego.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-16  7:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-15 23:16 [lto] use DECL_ASSEMBLER_NAME to compute section names Ollie Wild
2008-04-16  5:23 ` Kenneth Zadeck
2008-04-16  8:08 ` Diego Novillo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).