Message ID | CAFiYyc3wMv4Xw9GFQrN-GgJXZQ6aywVt123f5-jF+J339gJ27g@mail.gmail.com |
---|---|
State | New |
Headers | show |
Hi, Richi, Sorry if this comes in late. I'd saved your message for careful analysis and I only got back to it now. On Aug 1, 2012, Richard Guenther <richard.guenther@gmail.com> wrote: > On Fri, Dec 2, 2011 at 8:28 PM, Jakub Jelinek <jakub@redhat.com> wrote: >> PR debug/50317 >> * tree-ssa.c (target_for_debug_bind): Also allow is_gimple_reg_type >> vars that aren't referenced. >> (tree-ssa-live.c (remove_unused_locals): Don't clear TREE_ADDRESSABLE >> of unreferenced local vars. >> * cfgexpand.c (expand_debug_expr): For DEBUG_IMPLICIT_PTR allow also >> TREE_ADDRESSABLE vars that satisfy target_for_debug_bind. > But we do _not_ want to > have used non-register (but register type) variables tracked because we > do not track aliases? The reasoning, back when I wrote target_for_debug_bind, was that it didn't make sense to enable VTA for variables that were addressable, because the location of addressable variables isn't subject to change. Since their location is a constant address, we're better off avoiding all the VTA location wrangling and just using their unchanging MEM location. > - if (!is_gimple_reg (var)) > - { > - if (is_gimple_reg_type (TREE_TYPE (var)) > - && referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE) > - return var; > - return NULL_TREE; > - } > + /* var-tracking only tracks registers. */ > + if (!is_gimple_reg_type (TREE_TYPE (var))) > + return NULL_TREE; This change, although not incorrect, would subject lots of variables unnecessary VTA treatment, growing memory use and compile time.
Index: tree-ssa.c =================================================================== --- tree-ssa.c (revision 190031) +++ tree-ssa.c (working copy) @@ -259,13 +259,9 @@ target_for_debug_bind (tree var) if (DECL_IGNORED_P (var)) return NULL_TREE; - if (!is_gimple_reg (var)) - { - if (is_gimple_reg_type (TREE_TYPE (var)) - && referenced_var_lookup (cfun, DECL_UID (var)) == NULL_TREE) - return var; - return NULL_TREE; - } + /* var-tracking only tracks registers. */ + if (!is_gimple_reg_type (TREE_TYPE (var))) + return NULL_TREE; return var; }