aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorAldy Hernandez <aldyh@redhat.com>2010-03-18 20:41:40 +0000
committerAldy Hernandez <aldyh@gcc.gnu.org>2010-03-18 20:41:40 +0000
commitb1aa06558404f699aac25f84835dc04b16f437ea (patch)
tree31d500a237a9fb98246138a3525f9f448865c82f /gcc/varasm.c
parent9a05b749247561513b357e5648ed75699fc7cb4e (diff)
downloadgcc-b1aa06558404f699aac25f84835dc04b16f437ea.zip
gcc-b1aa06558404f699aac25f84835dc04b16f437ea.tar.gz
gcc-b1aa06558404f699aac25f84835dc04b16f437ea.tar.bz2
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
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c32
1 files changed, 32 insertions, 0 deletions
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. */