https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116219

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org,
                   |                            |rguenth at gcc dot gnu.org

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I think the norm_cache is innocent.
As discussed in other PRs, -g vs. -g0 can create further VAR_DECLs and other
decls, so DECL_UIDs can differ, but only in having bigger gaps in between them.

This fails because of a difference in vectorizer created names.
vect_create_data_ref_ptr is called on dr with
offset$D94316$_M_impl$D93629$_M_start_588
as DR_BASE_ADDRESS and the exact numbers in there after D do differ.
The underlying VAR_DECL is created by SRA and its former name SR.NNN is changed
in
2537          DECL_NAME (repl) = get_identifier (pretty_name);
2538          DECL_NAMELESS (repl) = 1;
Now, the DECL_NAMELESS causes careful handling for -fcompare-debug, either not
printing the decl at all, or sanitizing it through dump_fancy_name.
But the vectoririzer (vect_get_new_vect_var) calls
5305      base_name = get_name (DR_BASE_ADDRESS (dr));
which sets base_name to that
"offset$D94316$_M_impl$D93629$_M_start"
later on concatenates that with prefix, "vectp" in this case, so
"vectp_offset$D94316$_M_impl$D93629$_M_start"
and passes that to
5048          new_vect_var = create_tmp_reg (type, tmp);
which eventually calls create_tmp_var_name which calls clean_symbol_name and
replaces
the $s with _ and appends .NNN to it.

Now, I guess in order to fix this, we'd need get_name to tell the callers
whether it
was a name from DECL_NAMELESS decl or not.  And then some way how to arrange
for create_tmp_var_name to not clean those $s in there and arrange
DECL_NAMELESS to be set on the resulting DECL.

We have quite a few cases though:
function.cc:              local = create_tmp_var (type, get_name (parm));
function.cc:              addr = create_tmp_reg (ptr_type, get_name (parm));
gimplify.cc:  tree var = create_tmp_var (type, get_name (val));
gimplify.cc:      const char *name = get_name (val);
gimplify.cc:           SET_SSA_NAME_VAR_OR_IDENTIFIER (t, create_tmp_var_name
(name));
gimplify.cc:                  v = create_tmp_var (tmp, get_name (t));
gimplify.cc:  addr = create_tmp_var (ptr_type, get_name (decl));
gimplify.cc:      var = create_tmp_var (TREE_TYPE (decl), get_name (decl));
gimplify.cc:    var = create_tmp_var (TREE_TYPE (decl), get_name (decl));
omp-low.cc:      z = create_tmp_var_raw (TREE_TYPE (TREE_TYPE (new_vard)),
omp-low.cc:                           get_name (new_vard));
omp-low.cc:           const char *name = get_name (orig_var);
omp-low.cc:                  x = create_tmp_var_raw (type, name);
omp-low.cc:              tree y = create_tmp_var (ptype, name);
omp-low.cc:                  yb = create_tmp_var (ptype, name);
omp-low.cc:                      x = create_tmp_var_raw (TREE_TYPE (TREE_TYPE
(new_var)),
omp-low.cc:                                           get_name (var));
omp-low.cc:                       x = create_tmp_var_raw (type, get_name
(var));
omp-low.cc:                                  nx = create_tmp_var_raw (type,
omp-low.cc:                                                        get_name
(var));
omp-low.cc:                       nx = create_tmp_var_raw (type, get_name
(var));
omp-low.cc:             x = create_tmp_var_raw (type, get_name (new_var));
omp-low.cc:         x = create_tmp_var_raw (type, get_name (new_var));
omp-low.cc:         x = create_tmp_var_raw (TREE_TYPE (new_var), get_name
(new_var));
omp-low.cc:                     tree v = create_tmp_var_raw (type, get_name
(var));
omp-low.cc:                    x = create_tmp_var_raw (TREE_TYPE (TREE_TYPE
(new_var)),
omp-low.cc:                                         get_name (var));
omp-low.cc:                 v = create_tmp_var_raw (TREE_TYPE (v2), get_name
(var));
omp-low.cc:                     tree v = create_tmp_var_raw (type, get_name
(var));
omp-low.cc:                 tree t = create_tmp_var_raw (type, get_name (var));
tree-complex.cc:                          comp = create_tmp_reg (TREE_TYPE
(comp),
tree-complex.cc:                                                 get_name
(comp));
tree-parloops.cc:      const char *obj_name
tree-parloops.cc:       = get_name (TREE_OPERAND (TREE_OPERAND (*var_p, 0),
0));
tree-parloops.cc:        name = make_temp_ssa_name (TREE_TYPE (addr), NULL,
obj_name);
tree-parloops.cc:      var_copy = create_tmp_var (TREE_TYPE (var), get_name
(var));
tree-ssa-loop.cc:      name = get_name (TREE_OPERAND (ref, 1));
tree-ssa-loop.cc:      lsm_tmp_name_add (name);
tree-ssa-loop.cc:      name = get_name (ref);
tree-ssa-loop.cc:      lsm_tmp_name_add (name);
tree-ssa-structalias.cc:          res = get_name (decl);
tree-ssa-structalias.cc:          temp = xasprintf ("%s_%u", res ? res : "",
SSA_NAME_VERSION (decl));
tree-ssa-structalias.cc:          res = get_name (decl);
tree-ssa-structalias.cc:      unsigned int id = create_variable_info_for (t,
alias_get_name (t), false);
tree-vect-data-refs.cc:    base_name = get_name (data_ref_base);
tree-vect-data-refs.cc:      base_name = get_name (DR_REF (dr));
tree-vect-data-refs.cc:  dest = vect_get_new_vect_var (vect_ptr_type,
vect_pointer_var, base_name);
tree-vect-data-refs.cc:  base_name = get_name (DR_BASE_ADDRESS (dr));
tree-vect-data-refs.cc:  aggr_ptr = vect_get_new_vect_var (aggr_ptr_type,
vect_pointer_var, base_name);
tree-vect-data-refs.cc:  name = get_name (scalar_dest);
tree-vect-data-refs.cc:    new_name = xasprintf ("%s_%u", name,
SSA_NAME_VERSION (scalar_dest));
tree-vect-data-refs.cc:  vec_dest = vect_get_new_vect_var (type, kind,
new_name);

So, guess the question is whether we change get_name to be const char *get_name
(tree t, bool &nameless) or bool *nameless or return some class containing
const char * and flag pair, and how to change the
create_tmp_var/create_tmp_var_raw/create_tmp_var_name/
vect_get_new_vect_var to accept that additional info and act upon it.  And not
really sure about what tree-ssa-structalias.cc is doing (whether that can
appear in *.xkd dumps ever), or the lsm_tmp_name_add stuff.

Reply via email to