[Bug middle-end/70100] [5 Regression] ICE: in execute, at cfgexpand.c:6066

trippels at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Sun Mar 6 11:52:00 GMT 2016


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

Markus Trippelsdorf <trippels at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
      Known to work|                            |6.0
   Last reconfirmed|                            |2016-03-06
          Component|c++                         |middle-end
                 CC|                            |trippels at gcc dot gnu.org
     Ever confirmed|0                           |1
            Summary|internal compiler error: in |[5 Regression] ICE: in
                   |execute, at                 |execute, at
                   |cfgexpand.c:6066            |cfgexpand.c:6066
           Severity|major                       |normal

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
markus@x4 /tmp % cat main.ii
namespace std {
template <typename _Tp, _Tp> struct integral_constant {
  static constexpr _Tp value = 0;
};
template <typename _Tp> _Tp declval;
template <typename, typename>
struct is_same : integral_constant<bool, false> {};
template <typename _Tp> struct A { typedef _Tp type; };
template <typename _Tp> struct A<_Tp &> { typedef _Tp type; };
template <typename _Tp> struct B { typedef typename A<_Tp>::type type; };
template <bool> struct enable_if;
template <typename> struct C;
template <typename> struct D {};
template <typename _Tp, typename = C<_Tp>> struct F;
}
template <typename T> using Decay = typename std::B<T>::type;
namespace std {
struct G {
  G(int);
};
}
template <typename> struct Gen {
  template <typename Impl,
            typename = std::enable_if<std::is_same<Impl, int>::value>>
  Gen(Impl &&);
  struct H;
  template <typename> struct L;
  H *m_impl;
};
template <typename T> struct Gen<T>::H {};
template <typename T> template <typename Impl> struct Gen<T>::L : H {
  template <typename... Args> L(Args... args) : m_impl(args...), m_count(0) {
    m_impl(0, 0);
  }
  Impl m_impl;
  std::G m_count;
};
template <typename T>
template <typename Impl, typename>
Gen<T>::Gen(Impl &&impl) : m_impl(new L<Decay<Impl>>(impl)) {}
namespace state {
template <typename, typename> struct Command {
  using Model = int;
  using CommandType = Command;
};
template <typename CommandType> using Commands = std::F<std::D<CommandType>>;
template <typename MakeInitialState, typename Sut, typename GenFunc,
          typename = decltype(std::declval<MakeInitialState>)>
void check(MakeInitialState &&, Sut &, GenFunc &&);
namespace gen {
template <typename Cmd, typename MakeInitialState, typename GenerationFunc,
          typename = std::enable_if<
              std::is_same<MakeInitialState, typename Cmd::Model>::value>>
Gen<Commands<Cmd>> commands(MakeInitialState &&, GenerationFunc &&);
template <typename GenFunc> struct I {
  template <typename InitialStateArg, typename GenFuncArg>
  I(InitialStateArg, GenFuncArg);
  void operator()(int, int) { J(0, 0, m_genFunc, 0); }
  struct J {
    J(int, int, GenFunc, int) { m_genFunc(0); }
    GenFunc m_genFunc;
  };
  GenFunc m_genFunc;
};
template <typename Cmd, typename MakeInitialState, typename GenerationFunc,
          typename>
Gen<Commands<Cmd>> commands(MakeInitialState &&, GenerationFunc &&) {
  return I<Decay<GenerationFunc>>(0, 0);
}
}
template <typename MakeInitialState, typename Sut, typename GenFunc, typename>
void check(MakeInitialState &&, Sut &, GenFunc &&generationFunc) {
  using Model = Decay<decltype(0)>;
  gen::commands<Command<Model, Sut>>(0, generationFunc);
}
namespace gen {
template <typename Cmd> struct K {
  using CmdSP = std::D<typename Cmd::CommandType>;
  template <typename... Args> void operator()(Args... args) {
    using MakeFunc = CmdSP(...);
    MakeFunc makeFuncs;
    [=] { [=] { makeFuncs(args...); }; };
  }
};
template <typename Cmd> K<Cmd> execOneOfWithArgs();
}
}
using DbCommand = state::Command<int, int>;
struct Get : DbCommand {};
int main() {
  void db();
  check(0, db, state::gen::execOneOfWithArgs<Get>());
}

markus@x4 /tmp % /usr/x86_64-pc-linux-gnu/gcc-bin/5.3.1/g++ -std=c++14 -c
main.ii
main.ii: In member function ‘void state::gen::K<Cmd>::operator()(Args ...)
[with Args = {int}; Cmd = Get]’:
main.ii:79:36: internal compiler error: in execute, at cfgexpand.c:6069

Might be related to PR68798.


More information about the Gcc-bugs mailing list