public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: Dodji Seketeli <dodji@redhat.com>,
	Tobias Burnus <burnus@net-b.de>,
	       gcc patches <gcc-patches@gcc.gnu.org>,
	Wei Mi <wmi@google.com>,
	       Kostya Serebryany <kcc@google.com>,
	       Xinliang David Li <davidxl@google.com>
Subject: Re: [asan] Patch - fix an ICE in asan.c
Date: Mon, 12 Nov 2012 18:03:00 -0000	[thread overview]
Message-ID: <20121112180258.GQ1886@tucnak.redhat.com> (raw)
In-Reply-To: <20121112171308.GA32378@x4>

On Mon, Nov 12, 2012 at 06:13:08PM +0100, Markus Trippelsdorf wrote:
> Another ICE:
> 
>  % cat test.ii
>  int i;
> 
>  % g++ -faddress-sanitizer -c -g -O1 test.ii
> test.ii:1:7: internal compiler error: Segmentation fault
>   int i;
>        ^

The RECORD_TYPE doesn't have lang specific payload allocated for it.
There is no point why we need to describe that in the debug info though.

So I'd do something like:

2012-11-12  Jakub Jelinek  <jakub@redhat.com>

	* asan.c (report_error_func): Set DECL_IGNORED_P, don't touch
	DECL_ASSEMBLER_NAME.
	(asan_init_func): Likewise.
	(asan_finish_file): Use void * instead of __asan_global * as
	type of __asan_{,un}register_globals.  Set DECL_IGNORED_P on
	the decls.

--- gcc/asan.c.jj	2012-11-12 17:39:19.000000000 +0100
+++ gcc/asan.c	2012-11-12 18:54:57.164914324 +0100
@@ -493,10 +493,10 @@ report_error_func (bool is_store, int si
   fn_type = build_function_type_list (void_type_node, ptr_type_node, NULL_TREE);
   def = build_fn_decl (name, fn_type);
   TREE_NOTHROW (def) = 1;
+  DECL_IGNORED_P (def) = 1;
   TREE_THIS_VOLATILE (def) = 1;  /* Attribute noreturn. Surprise!  */
   DECL_ATTRIBUTES (def) = tree_cons (get_identifier ("leaf"),
 				     NULL, DECL_ATTRIBUTES (def));
-  DECL_ASSEMBLER_NAME (def);
   return def;
 }
 
@@ -511,7 +511,7 @@ asan_init_func (void)
   fn_type = build_function_type_list (void_type_node, NULL_TREE);
   def = build_fn_decl ("__asan_init", fn_type);
   TREE_NOTHROW (def) = 1;
-  DECL_ASSEMBLER_NAME (def);
+  DECL_IGNORED_P (def) = 1;
   return def;
 }
 
@@ -1535,11 +1535,11 @@ asan_finish_file (void)
       DECL_INITIAL (var) = ctor;
       varpool_assemble_decl (varpool_node_for_decl (var));
 
-      type = build_function_type_list (void_type_node,
-				       build_pointer_type (TREE_TYPE (type)),
+      type = build_function_type_list (void_type_node, ptr_type_node,
 				       uptr, NULL_TREE);
       decl = build_fn_decl ("__asan_register_globals", type);
       TREE_NOTHROW (decl) = 1;
+      DECL_IGNORED_P (decl) = 1;
       append_to_statement_list (build_call_expr (decl, 2,
 						 build_fold_addr_expr (var),
 						 build_int_cst (uptr, gcount)),
@@ -1547,6 +1547,7 @@ asan_finish_file (void)
 
       decl = build_fn_decl ("__asan_unregister_globals", type);
       TREE_NOTHROW (decl) = 1;
+      DECL_IGNORED_P (decl) = 1;
       append_to_statement_list (build_call_expr (decl, 2,
 						 build_fold_addr_expr (var),
 						 build_int_cst (uptr, gcount)),


	Jakub

  reply	other threads:[~2012-11-12 18:03 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-09 20:37 Tobias Burnus
2012-11-09 22:00 ` Tobias Burnus
2012-11-10  9:17 ` Jakub Jelinek
2012-11-10 13:17   ` Tobias Burnus
2012-11-10 15:18     ` Tobias Burnus
2012-11-10 18:54       ` Tobias Burnus
2012-11-12  8:42         ` Jakub Jelinek
2012-11-12 11:52 ` Dodji Seketeli
2012-11-12 15:46   ` Tobias Burnus
2012-11-12 16:44     ` Jakub Jelinek
2012-11-12 16:51       ` Dodji Seketeli
2012-11-12 17:13         ` Markus Trippelsdorf
2012-11-12 18:03           ` Jakub Jelinek [this message]
2012-11-12 20:28             ` Markus Trippelsdorf
2012-11-15 13:08             ` Dodji Seketeli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121112180258.GQ1886@tucnak.redhat.com \
    --to=jakub@redhat.com \
    --cc=burnus@net-b.de \
    --cc=davidxl@google.com \
    --cc=dodji@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=kcc@google.com \
    --cc=markus@trippelsdorf.de \
    --cc=wmi@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).