Bug 96863 - [9/10/11 Regression] ICE: in output_constructor_regular_field, at varasm.c:5223
Summary: [9/10/11 Regression] ICE: in output_constructor_regular_field, at varasm.c:5223
Status: RESOLVED DUPLICATE of bug 98463
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 11.0
: P2 normal
Target Milestone: 9.4
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 97126 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-08-31 09:57 UTC by gcc-bugs
Modified: 2022-03-08 22:10 UTC (History)
7 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2020-08-31 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gcc-bugs 2020-08-31 09:57:52 UTC
Hi gcc-team,

the following code ices:

```c++
#include <tuple>
namespace seqan3 {
template <typename, typename = void> struct pipeable_config_element;
template <typename derived_t>
struct pipeable_config_element<derived_t, void> {};
template <typename, typename value_t> struct pipeable_config_element {
  value_t value;
};
struct gap_scheme {
  int gap = 1;
};
template <typename... configs_t>
struct configuration : std::tuple<configs_t...> {
  template <typename derived_t, typename value_t>
  constexpr configuration(pipeable_config_element<derived_t, value_t> const) {}
  template <typename...> constexpr configuration(std::tuple<> const) {}
  template <typename config_element_t>
  constexpr auto push_back(config_element_t) const {
    return configuration<configs_t..., config_element_t>{std::tuple{}};
  }
};
template <typename derived_t, typename value_t>
configuration(pipeable_config_element<derived_t, value_t> const)
    -> configuration<derived_t>;
} // namespace seqan3
namespace seqan3::align_cfg {
template <typename gap_scheme_t>
struct gap : pipeable_config_element<gap<gap_scheme_t>, gap_scheme_t> {
  gap() = default;
  constexpr gap(gap_scheme_t const)
      : pipeable_config_element<gap, gap_scheme_t>() {}
};
} // namespace seqan3::align_cfg
namespace seqan3::detail {
struct method_local_tag : pipeable_config_element<method_local_tag> {};
} // namespace seqan3::detail
namespace seqan3::align_cfg {
seqan3::detail::method_local_tag method_local;
template <typename scoring_scheme_t>
struct scoring_scheme : pipeable_config_element<int, void> {
  scoring_scheme() = default;
  constexpr scoring_scheme(scoring_scheme_t) {};
};
struct aminoacid_scoring_scheme {};
template <typename config_t> struct alignment_fixture { config_t config; };
template <typename config_t>
alignment_fixture(config_t) -> alignment_fixture<config_t>;
inline constexpr auto align_config =
    seqan3::configuration{seqan3::align_cfg::method_local}.push_back(
        seqan3::align_cfg::gap{seqan3::gap_scheme{}});
static auto aa27_02 = [] {
  return alignment_fixture{align_config.push_back(
      seqan3::align_cfg::scoring_scheme{aminoacid_scoring_scheme{}})};
}();
} // namespace seqan3::align_cfg

```

https://godbolt.org/z/M4Mh1f

with

> g++-git -std=c++2a

error:

```
ice.cpp:55:1: internal compiler error: in output_constructor_regular_field, at varasm.c:5223
   55 | } // namespace seqan3::align_cfg
      | ^
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://bugs.archlinux.org/> for instructions.
```
Comment 1 Marek Polacek 2020-08-31 21:51:41 UTC
Confirmed.  Not a dup of 96282 because that was fixed already.  Can't bisect right now.
Comment 2 Marek Polacek 2020-09-01 01:03:53 UTC
Started with r268368.
Comment 3 Marek Polacek 2020-09-20 19:14:29 UTC
*** Bug 97126 has been marked as a duplicate of this bug. ***
Comment 4 Marek Polacek 2020-09-20 19:14:44 UTC
struct b {
  constexpr b() : c() {}
  [[no_unique_address]] struct a {} c;
};
struct d {
  constexpr d() : c() {}
  int c;
};
struct e : b, d {};
class f {
  float g = 1.0f;
  e h;
} i;
Comment 5 Sergei Trofimovich 2020-10-26 19:23:44 UTC
gcc's backtrace:

Breakpoint 2, internal_error (gmsgid=0x2df9a67 "in %s, at %s:%d") at ../../gcc/gcc/diagnostic.c:1752
1752    {
(gdb) bt
#0  internal_error (gmsgid=0x2df9a67 "in %s, at %s:%d") at ../../gcc/gcc/diagnostic.c:1752
#1  0x00000000023f2fa5 in fancy_abort (file=0x2679c8b "../../gcc/gcc/varasm.c", line=5402, function=0x267be88 "output_constructor_regular_field") at ../../gcc/gcc/diagnostic.c:1824
#2  0x0000000001668f0e in output_constructor_regular_field (local=0x7fffffffce10) at ../../gcc/gcc/varasm.c:5402
#3  0x0000000001669e37 in output_constructor (exp=0x7ffff7796a50, size=4, align=32, reverse=false, outer=0x0) at ../../gcc/gcc/varasm.c:5708
#4  0x0000000001668522 in output_constant (exp=0x7ffff7796a50, size=4, align=32, reverse=false, merge_strings=false) at ../../gcc/gcc/varasm.c:5217
#5  0x0000000001669255 in output_constructor_regular_field (local=0x7fffffffd030) at ../../gcc/gcc/varasm.c:5441
#6  0x0000000001669e37 in output_constructor (exp=0x7ffff7796a38, size=8, align=64, reverse=false, outer=0x0) at ../../gcc/gcc/varasm.c:5708
#7  0x0000000001668522 in output_constant (exp=0x7ffff7796a38, size=8, align=64, reverse=false, merge_strings=false) at ../../gcc/gcc/varasm.c:5217
#8  0x000000000165cf94 in assemble_variable_contents (decl=0x7ffff7ffbf30, name=0x7ffff7729268 "i", dont_output_data=false, merge_strings=false) at ../../gcc/gcc/varasm.c:2123
#9  0x000000000165da1e in assemble_variable (decl=0x7ffff7ffbf30, top_level=0, at_end=1, dont_output_data=0) at ../../gcc/gcc/varasm.c:2302
#10 0x000000000167b7b1 in varpool_node::assemble_decl (this=0x7ffff77af880) at ../../gcc/gcc/varpool.c:587
#11 0x00000000009d99c5 in cgraph_order_sort::process (this=0x3494738) at ../../gcc/gcc/cgraphunit.c:2073
#12 0x00000000009d9cab in output_in_order () at ../../gcc/gcc/cgraphunit.c:2138
#13 0x00000000009da2fb in symbol_table::compile (this=0x7ffff7645100) at ../../gcc/gcc/cgraphunit.c:2356
#14 0x00000000009da706 in symbol_table::finalize_compilation_unit (this=0x7ffff7645100) at ../../gcc/gcc/cgraphunit.c:2540
#15 0x000000000112b953 in compile_file () at ../../gcc/gcc/toplev.c:485
#16 0x000000000112ec8d in do_compile () at ../../gcc/gcc/toplev.c:2321
#17 0x000000000112efa6 in toplev::main (this=0x7fffffffd466, argc=22, argv=0x7fffffffd578) at ../../gcc/gcc/toplev.c:2460
#18 0x00000000023b8f9d in main (argc=22, argv=0x7fffffffd578) at ../../gcc/gcc/main.c:39
Comment 6 Sergei Trofimovich 2020-11-27 18:57:20 UTC
In we see ICEs related to '[[no_unique_address]]' on chromium source code: https://bugs.gentoo.org/757150 (a variant of #c4 example).
Comment 7 Marek Polacek 2021-01-21 21:24:20 UTC
Looks like a dup of bug 98463 which has more information.

*** This bug has been marked as a duplicate of bug 98463 ***