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

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

--- Comment #5 from Jakub Jelinek  ---
Author: jakub
Date: Tue Oct 10 20:09:01 2017
New Revision: 253611

URL: https://gcc.gnu.org/viewcvs?rev=253611=gcc=rev
Log:
PR middle-end/70100
* g++.dg/opt/pr70100.C: New test.

Added:
trunk/gcc/testsuite/g++.dg/opt/pr70100.C
Modified:
trunk/gcc/testsuite/ChangeLog

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

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|5.5 |6.0

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

2017-10-10 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

Jakub Jelinek  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||jakub at gcc dot gnu.org
 Resolution|--- |FIXED

--- Comment #4 from Jakub Jelinek  ---
Fixed with r228175 for 6.* and later, GCC 5 branch is being closed.

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

2017-08-08 Thread jaak at ristioja dot ee
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

--- Comment #3 from Jaak Ristioja  ---
(In reply to Markus Trippelsdorf from comment #1)
> template  struct K {
>   using CmdSP = std::D;
>   template  void operator()(Args... args) {
> using MakeFunc = CmdSP(...);
> MakeFunc makeFuncs;
> [=] { [=] { makeFuncs(args...); }; };
>   }
> };
...
> main.ii: In member function ‘void state::gen::K::operator()(Args ...)
> [with Args = {int}; Cmd = Get]’:
> main.ii:79:36: internal compiler error: in execute, at cfgexpand.c:6069

We hit a similar case in our proprietary production code, which compiled with
-O2 resulted in a segmentation fault, but when compiled with -O0, resulted in
this ICE.

Here is a smaller test-case to trigger this ICE with -std=c++11 -O0:

void b(int) {}

template 
void f(Args && ... args) {
[&] {
[&] {
b(args...);
};
};
}

int main() { f(2); }

// gcc (Gentoo Hardened 5.4.0-r3 p1.3, pie-0.6.5) 5.4.0

Dunno, if it is relevant, but here is some of the  disassembly output
at proprietary crash site with -O2 (attempting to read 1 byte from address 0x0,
according to Valgrind):

   0x00105aa024ab <+1643>:  mov%rax,%rbx
   0x00105aa024ae <+1646>:  movl   $0x1,0x8(%rax)
   0x00105aa024b5 <+1653>:  movl   $0x1,0xc(%rax)   
   0x00105aa024bc <+1660>:  lea0x2a7f35(%rip),%rax  #,
(__gnu_cxx::_Lock_policy)2> 
=> 0x00105aa024c3 <+1667>:  movzbl 0x0,%ecx

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

2016-06-03 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

Richard Biener  changed:

   What|Removed |Added

   Target Milestone|5.4 |5.5

--- Comment #2 from Richard Biener  ---
GCC 5.4 is being released, adjusting target milestone.

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

2016-03-07 Thread rguenth at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

Richard Biener  changed:

   What|Removed |Added

   Priority|P3  |P2
   Target Milestone|--- |5.4

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

2016-03-06 Thread trippels at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70100

Markus Trippelsdorf  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  ---
markus@x4 /tmp % cat main.ii
namespace std {
template  struct integral_constant {
  static constexpr _Tp value = 0;
};
template  _Tp declval;
template 
struct is_same : integral_constant {};
template  struct A { typedef _Tp type; };
template  struct A<_Tp &> { typedef _Tp type; };
template  struct B { typedef typename A<_Tp>::type type; };
template  struct enable_if;
template  struct C;
template  struct D {};
template > struct F;
}
template  using Decay = typename std::B::type;
namespace std {
struct G {
  G(int);
};
}
template  struct Gen {
  template ::value>>
  Gen(Impl &&);
  struct H;
  template  struct L;
  H *m_impl;
};
template  struct Gen::H {};
template  template  struct Gen::L : H {
  template  L(Args... args) : m_impl(args...), m_count(0) {
m_impl(0, 0);
  }
  Impl m_impl;
  std::G m_count;
};
template 
template 
Gen::Gen(Impl &) : m_impl(new L(impl)) {}
namespace state {
template  struct Command {
  using Model = int;
  using CommandType = Command;
};
template  using Commands = std::F;
template )>
void check(MakeInitialState &&, Sut &, GenFunc &&);
namespace gen {
template ::value>>
Gen commands(MakeInitialState &&, GenerationFunc &&);
template  struct I {
  template 
  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 
Gen commands(MakeInitialState &&, GenerationFunc &&) {
  return I(0, 0);
}
}
template 
void check(MakeInitialState &&, Sut &, GenFunc &) {
  using Model = Decay;
  gen::commands>(0, generationFunc);
}
namespace gen {
template  struct K {
  using CmdSP = std::D;
  template  void operator()(Args... args) {
using MakeFunc = CmdSP(...);
MakeFunc makeFuncs;
[=] { [=] { makeFuncs(args...); }; };
  }
};
template  K execOneOfWithArgs();
}
}
using DbCommand = state::Command;
struct Get : DbCommand {};
int main() {
  void db();
  check(0, db, state::gen::execOneOfWithArgs());
}

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::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.