diff options
author | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-18 20:41:40 +0000 |
---|---|---|
committer | aldyh <aldyh@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-03-18 20:41:40 +0000 |
commit | e6db644e168e952eba485ba7727808b3d24d4335 (patch) | |
tree | 31d500a237a9fb98246138a3525f9f448865c82f /gcc/varasm.c | |
parent | 967370edb1929e080226f60ea7d2260856e2f082 (diff) | |
download | gcc-e6db644e168e952eba485ba7727808b3d24d4335.tar.gz |
* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157551 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index 6b8222f8e9a..31007b8af86 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. */ |