[Bug c++/100468] set_up_extended_ref_temp via extend_ref_init_temps_1 drops TREE_ADDRESSABLE

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri May 7 10:13:30 GMT 2021


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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
The bug also causes g++.dg/tree-ssa/array-temp1.C to pass, notably the
gimplifiers gimplify_init_constructor to pass the

           && (flag_merge_constants >= 2 || !TREE_ADDRESSABLE (object))

test even though clearly the variable is address-taken, resulting in

  static const int C.1[3] = {1, 42, 3};

  try
    {
      a = {};
      a._M_len = 3;
      a._M_array = &C.1;
      _1 = std::initializer_list<int>::begin (&a);

I was tempted to add a || DECL_ARTIFICIAL (object) but Jakub says that's
probably not good.


More information about the Gcc-bugs mailing list