From b1aa06558404f699aac25f84835dc04b16f437ea Mon Sep 17 00:00:00 2001 From: Aldy Hernandez Date: Thu, 18 Mar 2010 20:41:40 +0000 Subject: tree.h: Declare make_decl_rtl_for_debug. * tree.h: Declare make_decl_rtl_for_debug. * varasm.c (make_decl_rtl_for_debug): New. * dwarf2out.c (rtl_for_decl_location): Call it. * cfgexpand.c (expand_debug_expr): Call it. From-SVN: r157551 --- gcc/varasm.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'gcc/varasm.c') diff --git a/gcc/varasm.c b/gcc/varasm.c index 6b8222f..31007b8 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -1476,6 +1476,38 @@ make_decl_rtl (tree decl) if (flag_mudflap && TREE_CODE (decl) == VAR_DECL) mudflap_enqueue_decl (decl); } + +/* Like make_decl_rtl, but inhibit creation of new alias sets when + calling make_decl_rtl. Also, reset DECL_RTL before returning the + rtl. */ + +rtx +make_decl_rtl_for_debug (tree decl) +{ + unsigned int save_aliasing_flag; + rtx rtl; + + if (DECL_RTL_SET_P (decl)) + return DECL_RTL (decl); + + /* Kludge alert! Somewhere down the call chain, make_decl_rtl will + call new_alias_set. If running with -fcompare-debug, sometimes + we do not want to create alias sets that will throw the alias + numbers off in the comparison dumps. So... clearing + flag_strict_aliasing will keep new_alias_set() from creating a + new set. */ + save_aliasing_flag = flag_strict_aliasing; + flag_strict_aliasing = 0; + + rtl = DECL_RTL (decl); + /* Reset DECL_RTL back, as various parts of the compiler expects + DECL_RTL set meaning it is actually going to be output. */ + SET_DECL_RTL (decl, NULL); + + flag_strict_aliasing = save_aliasing_flag; + + return rtl; +} /* Output a string of literal assembler code for an `asm' keyword used between functions. */ -- cgit v1.1