public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/63584] [4.8/4.9 Regression] ICE in strip_typedefs, at cp/tree.c:1326
Date: Sat, 18 Oct 2014 11:41:00 -0000	[thread overview]
Message-ID: <bug-63584-4-lLwByBmQDr@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-63584-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-10-18
                 CC|                            |trippels at gcc dot gnu.org
      Known to work|                            |5.0
   Target Milestone|---                         |4.8.5
            Summary|ICE in strip_typedefs, at   |[4.8/4.9 Regression] ICE in
                   |cp/tree.c:1326              |strip_typedefs, at
                   |                            |cp/tree.c:1326
     Ever confirmed|0                           |1
      Known to fail|                            |4.8.3, 4.9.1

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
 ~ % cat preprocessed_repro.ii
namespace std
{
template <typename _Tp, _Tp __v> struct A
{
  static constexpr _Tp value = __v;
};
typedef A<bool, false> false_type;
template <typename> void declval ();
struct __add_lvalue_reference_helper
{
  typedef int type;
};
int make_tuple ();
template <bool, typename, typename> struct __lazy_conditional;
template <typename T, typename F> struct __lazy_conditional<false, T, F>
{
  using type = typename F::type;
};
template <class Executor> struct B
{
  using execution_category = typename Executor::execution_category;
  using shape_type = struct tuple_of_references_t;
  template <class>
  struct C : __lazy_conditional<false_type::value, tuple_of_references_t,
                                __add_lvalue_reference_helper>
  {
  };
  template <class T> using shared_param_type = typename C<T>::type;
};
template <class, class T>
auto __make_tuple_if_not_nested (T) -> decltype (make_tuple ());
template <class Executor1, class Executor2> class D
{
  using outer_executor_type = Executor1;
  using inner_executor_type = Executor2;
  using outer_traits = B<outer_executor_type>;
  using inner_traits = B<inner_executor_type>;
  using inner_execution_category = typename inner_traits::execution_category;
  using outer_index_type = typename outer_traits::shape_type;
  using inner_shape_type = typename inner_traits::shape_type;

public:
  using shape_type
      = decltype (__make_tuple_if_not_nested<inner_execution_category> (
          declval<inner_shape_type>));
  template <class, class> struct inner_lambda_gcc49_workaround
  {
  };
  template <class Function, class Tuple>
  void
  bulk_async (Function, shape_type, Tuple shared_arg_tuple)
  {
    auto outer_shared_arg (shared_arg_tuple);
    using outer_shared_ref_type =
        typename outer_traits::template shared_param_type<decltype (
            outer_shared_arg)>;
    []
    {
      inner_lambda_gcc49_workaround<outer_index_type, outer_shared_ref_type>{};
    };
  }
};
class F
{
public:
  using execution_category = int;
};
}
main ()
{
  std::D<std::F, std::F> ex2;
  ex2.bulk_async ([]
                  {
                  },
                  std::make_tuple (), std::make_tuple);
}


 ~ % g++ -c -O0 -std=c++11 preprocessed_repro.ii
preprocessed_repro.ii: In instantiation of 'std::D<Executor1,
Executor2>::bulk_async(Function, std::D<Executor1, Executor2>::shape_type,
Tuple)::<lambda()> [with Function = main()::<lambda()>; Tuple = int (*)();
Executor1 = std::F; Executor2 = std::F]':
preprocessed_repro.ii:57:6:   required from 'struct std::D<Executor1,
Executor2>::bulk_async(Function, std::D<Executor1, Executor2>::shape_type,
Tuple) [with Function = main()::<lambda()>; Tuple = int (*)(); Executor1 =
std::F; Executor2 = std::F; std::D<Executor1, Executor2>::shape_type = int;
std::D<Executor1, Executor2>::inner_execution_category = int; std::D<Executor1,
Executor2>::inner_shape_type = std::tuple_of_references_t]::<lambda()>'
preprocessed_repro.ii:57:5:   required from 'void std::D<Executor1,
Executor2>::bulk_async(Function, std::D<Executor1, Executor2>::shape_type,
Tuple) [with Function = main()::<lambda()>; Tuple = int (*)(); Executor1 =
std::F; Executor2 = std::F; std::D<Executor1, Executor2>::shape_type = int;
std::D<Executor1, Executor2>::inner_execution_category = int; std::D<Executor1,
Executor2>::inner_shape_type = std::tuple_of_references_t]'
preprocessed_repro.ii:75:54:   required from here
preprocessed_repro.ii:59:7: internal compiler error: in strip_typedefs, at
cp/tree.c:1326
       inner_lambda_gcc49_workaround<outer_index_type,
outer_shared_ref_type>{};
       ^
0x6118b7 strip_typedefs(tree_node*)
        ../../gcc-4.9.1-src/gcc/cp/tree.c:1326
0x558e4c canonicalize_type_argument
        ../../gcc-4.9.1-src/gcc/cp/pt.c:6349
0x5672e0 coerce_template_parms
        ../../gcc-4.9.1-src/gcc/cp/pt.c:7002
0x56ba4a lookup_template_class_1
        ../../gcc-4.9.1-src/gcc/cp/pt.c:7551
0x56ba4a lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:7886
0x56dbe7 tsubst_aggr_type
        ../../gcc-4.9.1-src/gcc/cp/pt.c:10196
0x568493 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:11604
0x5612f6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:15075
0x5656ff tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:14016
0x5647af tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:13432
0x5656cd tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:13623
0x5656cd tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:13623
0x564402 instantiate_decl(tree_node*, int, bool)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:19922
0x579d11 instantiate_class_template_1
        ../../gcc-4.9.1-src/gcc/cp/pt.c:9367
0x579d11 instantiate_class_template(tree_node*)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:9435
0x5cfffd complete_type(tree_node*)
        ../../gcc-4.9.1-src/gcc/cp/typeck.c:134
0x560db6 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc-4.9.1-src/gcc/cp/pt.c:15284
0x5656ff tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:14016
0x5647af tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:13432
0x564fd4 tsubst_expr
        ../../gcc-4.9.1-src/gcc/cp/pt.c:13418
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.


  reply	other threads:[~2014-10-18 11:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-18  4:46 [Bug c++/63584] New: " jaredhoberock at gmail dot com
2014-10-18 11:41 ` trippels at gcc dot gnu.org [this message]
2014-12-10 13:15 ` [Bug c++/63584] [4.8/4.9 Regression] " rguenth at gcc dot gnu.org
2014-12-19 13:31 ` jakub at gcc dot gnu.org
2015-06-23  8:26 ` rguenth at gcc dot gnu.org
2015-06-26 19:59 ` [Bug c++/63584] [4.9 " jakub at gcc dot gnu.org
2015-06-26 20:39 ` jakub at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-63584-4-lLwByBmQDr@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).