diff options
author | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-05 10:43:36 +0000 |
---|---|---|
committer | jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-05-05 10:43:36 +0000 |
commit | a2f58a79622e005e982b17ee5a84e5c90bb7ae80 (patch) | |
tree | 59842b6dc18621e5312a68fbb0c8fbf681aa0180 /gcc/varasm.c | |
parent | a238367fa353f7ee1af60ef845766d183dbfd337 (diff) | |
download | gcc-a2f58a79622e005e982b17ee5a84e5c90bb7ae80.tar.gz |
PR debug/43478
* df-problems.c (struct dead_debug_use, struct dead_debug): New.
(dead_debug_init, dead_debug_finish): New functions.
(dead_debug_add, dead_debug_insert_before): Likewise.
(df_note_bb_compute): Initialize a dead_debug object, add dead
debug uses to it, insert debug bind insns before death insns,
reset debug insns that refer to pending uses at the end.
* rtl.h (make_debug_expr_from_rtl): New prototype.
* varasm.c (make_debug_expr_from_rtl): New function.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159063 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r-- | gcc/varasm.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c index bcb5b114238..9f2f0a6f957 100644 --- a/gcc/varasm.c +++ b/gcc/varasm.c @@ -7261,4 +7261,31 @@ default_elf_asm_output_external (FILE *file ATTRIBUTE_UNUSED, maybe_assemble_visibility (decl); } +/* Create a DEBUG_EXPR_DECL / DEBUG_EXPR pair from RTL expression + EXP. */ +rtx +make_debug_expr_from_rtl (const_rtx exp) +{ + tree ddecl = make_node (DEBUG_EXPR_DECL), type; + enum machine_mode mode = GET_MODE (exp); + rtx dval; + + DECL_ARTIFICIAL (ddecl) = 1; + if (REG_P (exp) && REG_EXPR (exp)) + type = TREE_TYPE (REG_EXPR (exp)); + else if (MEM_P (exp) && MEM_EXPR (exp)) + type = TREE_TYPE (MEM_EXPR (exp)); + else + type = NULL_TREE; + if (type && TYPE_MODE (type) == mode) + TREE_TYPE (ddecl) = type; + else + TREE_TYPE (ddecl) = lang_hooks.types.type_for_mode (mode, 1); + DECL_MODE (ddecl) = mode; + dval = gen_rtx_DEBUG_EXPR (mode); + DEBUG_EXPR_TREE_DECL (dval) = ddecl; + SET_DECL_RTL (ddecl, dval); + return dval; +} + #include "gt-varasm.h" |