public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591
@ 2020-04-02  7:34 jakub at gcc dot gnu.org
  2020-04-02  7:35 ` [Bug c++/94453] " jakub at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-02  7:34 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94453
           Summary: [10 Regression] ICE in make_decl_rtl since r10-3591
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Since r10-3591-gb830c28b56fdc3f4b4555200278218b4b49022d2 the following testcase
ICEs with -O2 -std=c++17:
./cc1plus -quiet -O2 -std=c++17 rh1819335.ii 
during RTL pass: expand
rh1819335.ii: In static member function ‘static ar t<ar(ad ...), h>::bf(const
s&, ad ...) [with ar = void; h = b(G<cn::v*>)::<lambda()>; ad = {}]’:
rh1819335.ii:103:29: internal compiler error: in make_decl_rtl, at
varasm.c:1346
  103 |   auto q = [=] { exclude->di(p, data->cg().cw()); };
      |                  ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
0x1a98085 make_decl_rtl(tree_node*)
        ../../gcc/varasm.c:1342
0x1044655 expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
        ../../gcc/expr.c:10085
0x103c4e3 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
        ../../gcc/expr.c:8353
0xe424f1 expand_expr
        ../../gcc/expr.h:282
0xe55ad7 store_one_arg
        ../../gcc/calls.c:5973
0xe50238 expand_call(tree_node*, rtx_def*, int)
        ../../gcc/calls.c:4476

template <int b> struct c { static constexpr int d = b; };
template <bool b> using e = c<b>;
template <bool, bool, typename...> struct g;
template <typename h, typename... ad> struct g<false, false, h, ad...> {
  typedef decltype(0) i;
};
template <typename... ad> struct k : g<c<false>::d, c<false>::d, ad...> {};
template <bool, typename f = void> using ag = f;
struct r { c<true> j; using i = decltype(j); };
template <typename...> constexpr bool ak = r::i ::d;
template <typename, typename an, typename... al> void ao(an ap, al... aq) {
  ap(aq...);
}
template <typename, typename as, typename... al> ag<ak<>> at(as au, al... aq) {
  using av = k<as>;
  using aw = typename av::i;
  ao<aw>(au, aq...);
}
struct s {
  void *ay();
  template <typename f> f ay() { return *static_cast<f *>(ay()); }
};
template <typename> class az;
template <typename h> class bb {
protected:
  static h *bc(s bd) { return bd.ay<h *>(); }
};
template <typename, typename> class t;
template <typename ar, typename h, typename... ad>
struct t<ar(ad...), h> : bb<h> {
  static ar bf(const s &bg, ad... aq) {
    auto bh = bb<h>::bc(bg);
    at<ar>(*bh, aq...);
  }
};
template <typename ar, typename... ad> struct az<ar(ad...)> {
  template <typename, typename f> using bj = f;
  template <typename h, typename = bj<e<!bool()>, void>, typename = bj<r,
void>>
  az(h);
  using bk = ar (*)(const s &, ad...);
  bk bl;
};
template <typename ar, typename... ad>
template <typename h, typename, typename>
az<ar(ad...)>::az(h) { bl = t<ar(ad...), h>::bf; }
template <class bo> struct G {
  template <typename bp> G(bp);
  bo operator->() const;
};
namespace bq {
struct H { template <typename bs> bs *bt(); };
struct I { template <typename bz> I(bz); };
template <typename, typename> using cb = I;
class u : cb<int, int> { using cc = cb<int, int>; using cc::cc; };
template <typename bs> struct J { bs cg(); };
}
template <typename ch> using ci = az<ch>;
template <typename cj> struct ck { using cl = cj; constexpr ck(cl) {}
};
template <typename cl> constexpr auto l(cl d) { return ck(d); }
template <typename cl> constexpr auto operator|(cl a, cl) {
  auto cm = l(a);
  return cm;
}
namespace cn {
struct v { bq::H br(); };
}
namespace cp {
struct cq {
  enum cr { cs, ct };
  using cv = ck<cr>;
  const int &cw() const;
};
}
namespace cn {
namespace cx {
auto cy() {}
}
struct w {
  void da(ci<void()>);
};
}
using db = cn::w;
G<db *> dc(int, bq::u, int);
namespace de {
int m;
}
using cr = cp::cq;
using cv = cp::cq::cv;
using df = const int &;
using dg = df (cp::cq::*)() const;
struct x { void di(cv, int); };
G<x *> dj(int, G<int>, ci<void(cp::cq)>, cv, dg);
void dk(int, G<int>, cv, G<int>, ci<void(cp::cq)>, ci<void()>);
void b(G<cn::v *> box) {
  int dm, content = 0;
  using dn = bq::J<cp::cq>;
  auto data = box->br().bt<dn>();
  auto n = [](cp::cq) {};
  constexpr auto p = cr::cs | cr::ct;
  auto o = dc(content, cn::cx::cy, de::m);
  auto exclude = dj(content, data, n, p, &cp::cq::cw);
  auto q = [=] { exclude->di(p, data->cg().cw()); };
  o->da([=] { dk(dm, box, p, data, n, q); });
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
@ 2020-04-02  7:35 ` jakub at gcc dot gnu.org
  2020-04-02 10:02 ` marxin at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2020-04-02  7:35 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
   Target Milestone|---                         |10.0
                 CC|                            |jason at gcc dot gnu.org
           Keywords|                            |ice-on-valid-code

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
  2020-04-02  7:35 ` [Bug c++/94453] " jakub at gcc dot gnu.org
@ 2020-04-02 10:02 ` marxin at gcc dot gnu.org
  2020-04-02 11:15 ` ensadc at mailnesia dot com
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-04-02 10:02 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2020-04-02
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Martin Liška <marxin at gcc dot gnu.org> ---
Confirmed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
  2020-04-02  7:35 ` [Bug c++/94453] " jakub at gcc dot gnu.org
  2020-04-02 10:02 ` marxin at gcc dot gnu.org
@ 2020-04-02 11:15 ` ensadc at mailnesia dot com
  2020-04-03 20:07 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: ensadc at mailnesia dot com @ 2020-04-02 11:15 UTC (permalink / raw)
  To: gcc-bugs

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

ensadc at mailnesia dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ensadc at mailnesia dot com

--- Comment #2 from ensadc at mailnesia dot com ---
void *ay();
template <typename f> f ay() { return *static_cast<f *>(ay()); }
template <typename h>
void bf() {
  ay<h>()();
}
struct az {
  template <typename h>
  az(h);
  using bk = void (*)();
  bk bl;
};
template <typename h>
az::az(h) { bl = bf<h>; }
struct A {};
void da(az);
void di(A, int);
void dk(A, az, az);
void b() {
  int data = 0;
  auto n = [] {};
  constexpr auto p = A{};
  auto q = [=] { di(p, data); };
  da([=] { dk(p, n, q); });
}

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2020-04-02 11:15 ` ensadc at mailnesia dot com
@ 2020-04-03 20:07 ` jason at gcc dot gnu.org
  2020-04-04 15:06 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-03 20:07 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2020-04-03 20:07 ` jason at gcc dot gnu.org
@ 2020-04-04 15:06 ` cvs-commit at gcc dot gnu.org
  2020-04-04 15:09 ` jason at gcc dot gnu.org
  2020-04-04 22:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-04 15:06 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:9f143008c73c60e02634d6b433139a035ef7bb65

commit r10-7553-g9f143008c73c60e02634d6b433139a035ef7bb65
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Apr 4 11:04:55 2020 -0400

    c++: Fix reuse of class constants [PR94453]

    The testcase hit an ICE trying to expand a TARGET_EXPR temporary cached
from
    the other lambda-expression.  This patch fixes this in two ways:

    1) Avoid reusing a TARGET_EXPR from another function.
    2) Avoid ending up with a TARGET_EXPR at all; the use of 'p' had become
    <TARGET_EXPR<NON_LVALUE_EXPR<TARGET_EXPR ...>>>, which doesn't make any
    sense.

    gcc/cp/ChangeLog
    2020-04-04  Jason Merrill  <jason@redhat.com>

            PR c++/94453
            * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
            * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR
in
            NON_LVALUE_EXPR.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2020-04-04 15:06 ` cvs-commit at gcc dot gnu.org
@ 2020-04-04 15:09 ` jason at gcc dot gnu.org
  2020-04-04 22:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2020-04-04 15:09 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|ASSIGNED                    |RESOLVED

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [Bug c++/94453] [10 Regression] ICE in make_decl_rtl since r10-3591
  2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2020-04-04 15:09 ` jason at gcc dot gnu.org
@ 2020-04-04 22:35 ` cvs-commit at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-04-04 22:35 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-9 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:5ed8c71b53a5ac93c68179770cb047227b587bcb

commit r9-8452-g5ed8c71b53a5ac93c68179770cb047227b587bcb
Author: Jason Merrill <jason@redhat.com>
Date:   Sat Apr 4 11:04:55 2020 -0400

    c++: Fix reuse of class constants [PR94453]

    The testcase hit an ICE trying to expand a TARGET_EXPR temporary cached
from
    the other lambda-expression.  This patch fixes this in two ways:

    1) Avoid reusing a TARGET_EXPR from another function.
    2) Avoid ending up with a TARGET_EXPR at all; the use of 'p' had become
    <TARGET_EXPR<NON_LVALUE_EXPR<TARGET_EXPR ...>>>, which doesn't make any
    sense.

    gcc/cp/ChangeLog
    2020-04-04  Jason Merrill  <jason@redhat.com>

            PR c++/94453
            * constexpr.c (maybe_constant_value): Use break_out_target_exprs.
            * expr.c (mark_use) [VIEW_CONVERT_EXPR]: Don't wrap a TARGET_EXPR
in
            NON_LVALUE_EXPR.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-04-04 22:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02  7:34 [Bug c++/94453] New: [10 Regression] ICE in make_decl_rtl since r10-3591 jakub at gcc dot gnu.org
2020-04-02  7:35 ` [Bug c++/94453] " jakub at gcc dot gnu.org
2020-04-02 10:02 ` marxin at gcc dot gnu.org
2020-04-02 11:15 ` ensadc at mailnesia dot com
2020-04-03 20:07 ` jason at gcc dot gnu.org
2020-04-04 15:06 ` cvs-commit at gcc dot gnu.org
2020-04-04 15:09 ` jason at gcc dot gnu.org
2020-04-04 22:35 ` cvs-commit at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).