[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-04-06 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

Marek Polacek  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Marek Polacek  ---
Fixed.

[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-04-06 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Marek Polacek :

https://gcc.gnu.org/g:f84aded848f6fdd2704c9376263c6d1aee6bb0ca

commit r10-7568-gf84aded848f6fdd2704c9376263c6d1aee6bb0ca
Author: Marek Polacek 
Date:   Mon Mar 30 15:49:17 2020 -0400

c++: Fix crash in gimplifier with paren init of aggregates [PR94155]

Here we crash in the gimplifier because gimplify_init_ctor_eval doesn't
expect null indexes for a constructor:

  /* ??? Here's to hoping the front end fills in all of the indices,
 so we don't have to figure out what's missing ourselves.  */
  gcc_assert (purpose);

The indexes weren't filled because we never called reshape_init: for
a constructor that represents parenthesized initialization of an
aggregate we don't allow brace elision or designated initializers.

PR c++/94155 - crash in gimplifier with paren init of aggregates.
* init.c (build_vec_init): Fill in indexes.

* g++.dg/cpp2a/paren-init22.C: New test.

[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-03-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

--- Comment #3 from Marek Polacek  ---
Even simpler:

struct S { int i, j; };

struct A {
  S s;
  constexpr A(S e) : s(e) {}
};

void
f()
{
  A g[1]({{1, 1}});
}

[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-03-27 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

--- Comment #2 from Marek Polacek  ---
Reduced:

template  struct A {
  int i;
  T t;
  constexpr A(int, T e) : i(), t(e) {}
};

void
f()
{
  A> g[1]({1, {1, 1}});
}

We ICE because we don't satisfy:
 4662   /* ??? Here's to hoping the front end fills in all of the indices,
 4663  so we don't have to figure out what's missing ourselves.  */
 4664   gcc_assert (purpose);

[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-03-12 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

Marek Polacek  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Assignee|unassigned at gcc dot gnu.org  |mpolacek at gcc dot 
gnu.org
 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-03-12

[Bug c++/94155] internal compiler error: in gimplify_init_ctor_eval, at gimplify.c:4664

2020-03-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94155

Jonathan Wakely  changed:

   What|Removed |Added

   Keywords||needs-reduction

--- Comment #1 from Jonathan Wakely  ---
The same variable definition works at namespace scope, I only get the ICE an
function scope.

My brief attempts to reduce it to remove std::pair made the ICE go away.