public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
@ 2015-08-09  9:08 trippels at gcc dot gnu.org
  2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-08-09  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 67164
           Summary: [6 Regression] ICE: tree check: expected class
                    ‘expression’, have ‘exceptional’
                    (argument_pack_select) in tree_operand_check, at
                    tree.h:3356
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: trippels at gcc dot gnu.org
  Target Milestone: ---

% cat github_113.ii
namespace std {
template <typename _Tp> struct integral_constant {
  static constexpr _Tp value = 0;
};
template <bool, typename, typename> struct conditional;
template <typename...> struct __or_;
template <typename _B1, typename _B2>
struct __or_<_B1, _B2> : conditional<1, _B1, _B2> {};
template <typename...> struct __and_;
template <typename _B1, typename _B2>
struct __and_<_B1, _B2> : conditional<1, _B2, _B1> {};
template <typename> struct is_rvalue_reference;
template <typename _Tp>
struct is_reference
    : __or_<integral_constant<bool>, is_rvalue_reference<_Tp>>::type {};
template <typename _Tp> _Tp declval();
struct __do_is_direct_constructible_impl {
  template <typename _Tp, typename _Arg,
            typename = decltype(_Tp(declval<_Arg>()))>
  static integral_constant<bool> __test(int);
};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_impl : __do_is_direct_constructible_impl {
  decltype(__test<_Tp, _Arg>(0)) type;
};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_new_safe
    : __and_<int, __is_direct_constructible_impl<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible_new
    : conditional<is_reference<_Tp>::value, int,
                  __is_direct_constructible_new_safe<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible
    : __is_direct_constructible_new<_Tp, _Arg>::type {};
template <typename...> struct __is_nary_constructible;
template <typename _Tp, typename _Arg>
struct __is_nary_constructible<_Tp, _Arg>
    : __is_direct_constructible<_Tp, _Arg> {};
template <typename _Tp, typename... _Args>
struct is_constructible : __is_nary_constructible<_Tp, _Args...>::type {};
template <bool> struct enable_if;
template <bool, typename _Iftrue, typename> struct conditional {
  typedef _Iftrue type;
};
template <typename _Iftrue, typename _Iffalse>
struct conditional<false, _Iftrue, _Iffalse> {
  typedef _Iffalse type;
};
}
namespace boost {
namespace hana {
template <bool> struct fast_and;
template <typename... Xn> struct closure {
  template <typename... Yn,
            typename = std::enable_if<
                fast_and<std::is_constructible<Xn, Yn &&>::value...>::value>>
  closure(Yn...);
  template <typename... Yn,
            typename std::enable_if<
                fast_and<std::is_constructible<Yn>::value...>::value>::type>
  closure(closure<Yn...>);
};
template <typename> struct make_impl;
template <typename Datatype> struct make_t {
  template <typename... X> decltype(auto) operator()(X... x) {
    return make_impl<Datatype>::apply(x...);
  }
};
template <typename Datatype> make_t<Datatype> make;
struct Pair;
auto make_pair = make<Pair>;
struct Tuple;
auto make_tuple = make<Tuple>;
template <> struct make_impl<Tuple> {
  template <typename... Xs> static closure<Xs...> apply(Xs &&...);
};
struct pair : closure<> {
  using closure::closure;
};
template <> struct make_impl<Pair> {
  template <typename F, typename S> static pair apply(F, S);
};
namespace struct_detail {
template <typename Memptr, Memptr> struct member_ptr {};
template <int, typename> auto prepare_member_name_impl() {}
template <int n, typename> auto prepare_member_name() {
  return prepare_member_name_impl<n, int>;
}
}
}
}
struct Person {
  int Person;
  auto apply() {
    struct member_names;
    boost::hana::make_tuple(boost::hana::make_pair(
        boost::hana::struct_detail::prepare_member_name<0, member_names>(),
        boost::hana::struct_detail::member_ptr<decltype(&Person::Person),
                                               &Person::Person>{}));
  }
};

 % clang++ -std=c++14 -c github_113.ii
 %

(gcc-5 rejects the testcase)
 % g++ -std=c++14 -c github_113.ii
github_113.ii: In instantiation of ‘struct
std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’:
github_113.ii:41:8:   required from ‘struct
std::is_constructible<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:56:13:   required by substitution of ‘template<class ... Yn,
class> boost::hana::closure<Xn>::closure(Yn ...) [with Yn =
boost::hana::closure<boost::hana::pair&
>; <template-parameter-1-2> = <missing>]’
github_113.ii:67:43:   required from ‘decltype(auto)
boost::hana::make_t<Datatype>::operator()(X ...) [with X = {boost::hana::pair};
Datatype = boost::hana::Tuple]’
github_113.ii:100:67:   required from here
github_113.ii:24:29: error: no matching function for call to
‘std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>::__test(int)
’
   decltype(__test<_Tp, _Arg>(0)) type;
                             ^
github_113.ii:20:34: note: candidate: template<class _Tp, class _Arg, class>
static std::integral_constant<bool>
std::__do_is_direct_constructible_impl::__test(int)
   static integral_constant<bool> __test(int);
                                  ^
github_113.ii:20:34: note:   template argument deduction/substitution failed:
github_113.ii:19:13: error: invalid cast of an rvalue expression of type
‘boost::hana::closure<boost::hana::pair&>’ to type ‘boost::hana::pair&’
             typename = decltype(_Tp(declval<_Arg>()))>
             ^

(trunk ICEs since r214396)
 % g++ -c github_113.ii
github_113.ii: In substitution of ‘template<class ... Yn, typename
std::enable_if<boost::hana::fast_and<std::is_constructible<Yn>::value
...>::value>::type <anonymous> >
boost::hana::pair::pair(boost::hana::closure<Xs ...>) [with Yn = <missing>;
typename std::enable_if<boost::hana::fast_and<std::is_constructible<Yn>::value
...>::value>::type <anonymous> = <missing>]’:
github_113.ii:19:13:   required by substitution of ‘template<class _Tp, class
_Arg, class> static std::integral_constant<bool>
std::__do_is_direct_constructible_impl::__test(int) [with _Tp =
boost::hana::pair&; _Arg = boost::hana::closure<boost::hana::pair&>&&;
<template-parameter-1-3> = <missing>]’
github_113.ii:24:29:   required from ‘struct
std::__is_direct_constructible_impl<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:41:8:   required from ‘struct
std::is_constructible<boost::hana::pair&,
boost::hana::closure<boost::hana::pair&>&&>’
github_113.ii:56:13:   required by substitution of ‘template<class ... Yn,
class> boost::hana::closure<Xn>::closure(Yn ...) [with Yn =
boost::hana::closure<boost::hana::pair&>; <template-parameter-1-2> =
<missing>]’
github_113.ii:67:43:   required from ‘decltype(auto)
boost::hana::make_t<Datatype>::operator()(X ...) [with X = {boost::hana::pair};
Datatype = boost::hana::Tuple]’
github_113.ii:100:67:   required from here
github_113.ii:19:13: internal compiler error: tree check: expected class
‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check,
at tree.h:3356
             typename = decltype(_Tp(declval<_Arg>()))>
             ^
0x10d3fcb7 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9550
0x101160e3 expr_check
        ../../gcc/gcc/tree.h:3027
0x101160e3 tree_operand_check
        ../../gcc/gcc/tree.h:3356
0x102387cb tree_operand_check
        ../../gcc/gcc/tree.h:2972
0x102387cb unify
        ../../gcc/gcc/cp/pt.c:19046
0x102360ab unify
        ../../gcc/gcc/cp/pt.c:19096
0x101167b3 try_class_unification
        ../../gcc/gcc/cp/pt.c:18100
0x102356db unify
        ../../gcc/gcc/cp/pt.c:19134
0x1023a96f unify_one_argument
        ../../gcc/gcc/cp/pt.c:17450
0x10230277 type_unification_real
        ../../gcc/gcc/cp/pt.c:17522
0x10241453 fn_type_unification(tree_node*, tree_node*, tree_node*, tree_node*
const*, unsigned int, tree_node*, unification_kind_t, int, bool, bool)
        ../../gcc/gcc/cp/pt.c:16969
0x1018b31b add_template_candidate_real
        ../../gcc/gcc/cp/call.c:3054
0x1018bf4f add_template_candidate
        ../../gcc/gcc/cp/call.c:3151
0x1018bf4f add_candidates
        ../../gcc/gcc/cp/call.c:5307
0x101875d3 build_user_type_conversion_1
        ../../gcc/gcc/cp/call.c:3662
0x10187ffb implicit_conversion
        ../../gcc/gcc/cp/call.c:1853
0x1018981b reference_binding
        ../../gcc/gcc/cp/call.c:1701
0x10187e27 implicit_conversion
        ../../gcc/gcc/cp/call.c:1792
0x10191aef perform_direct_initialization_if_possible(tree_node*, tree_node*,
bool, int)
        ../../gcc/gcc/cp/call.c:9570
0x10342c73 build_static_cast_1
        ../../gcc/gcc/cp/typeck.c:6631
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.
>From gcc-bugs-return-494466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 09 09:45:02 2015
Return-Path: <gcc-bugs-return-494466-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 26001 invoked by alias); 9 Aug 2015 09:45:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25963 invoked by uid 48); 9 Aug 2015 09:44:57 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67164] ICE: tree check:=?UTF-8?Q? expected class ‘expression’?=,=?UTF-8?Q? have ‘exceptional’ ?=(argument_pack_select) in tree_operand_check, at tree.h:3356
Date: Sun, 09 Aug 2015 09:45:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: short_desc cf_known_to_fail
Message-ID: <bug-67164-4-hetVfLzPs8@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg00608.txt.bz2
Content-length: 2106

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[6 Regression] ICE: tree    |ICE: tree check: expected
                   |check: expected class       |class ‘expression’, have
                   |‘expression’, have          |‘exceptional’
                   |‘exceptional’               |(argument_pack_select) in
                   |(argument_pack_select) in   |tree_operand_check, at
                   |tree_operand_check, at      |tree.h:3356
                   |tree.h:3356                 |
      Known to fail|                            |5.1.0, 6.0

--- Comment #1 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
With --enable-checking gcc-5 also ICEs.

gcc-4.9 rejects the testcase:

github_113.ii:70:47: error: template declaration of
‘boost::hana::make_t<Datatype> boost::hana::make’
 template <typename Datatype> make_t<Datatype> make;
                                               ^
github_113.ii:72:18: error: ‘make’ was not declared in this scope
 auto make_pair = make<Pair>;
                  ^
github_113.ii:72:27: error: expected primary-expression before ‘>’ token
 auto make_pair = make<Pair>;
                           ^
github_113.ii:72:28: error: expected primary-expression before ‘;’ token
 auto make_pair = make<Pair>;
                            ^
github_113.ii:74:19: error: ‘make’ was not declared in this scope
 auto make_tuple = make<Tuple>;
                   ^
github_113.ii:74:29: error: expected primary-expression before ‘>’ token
 auto make_tuple = make<Tuple>;
                             ^
github_113.ii:74:30: error: expected primary-expression before ‘;’ token
 auto make_tuple = make<Tuple>;
                              ^
>From gcc-bugs-return-494467-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Aug 09 10:33:07 2015
Return-Path: <gcc-bugs-return-494467-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 73269 invoked by alias); 9 Aug 2015 10:33:07 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 73207 invoked by uid 48); 9 Aug 2015 10:33:02 -0000
From: "trippels at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67164] ICE: tree check:=?UTF-8?Q? expected class ‘expression’?=,=?UTF-8?Q? have ‘exceptional’ ?=(argument_pack_select) in tree_operand_check, at tree.h:3356
Date: Sun, 09 Aug 2015 10:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: trippels at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-67164-4-kT1dwZPJ0m@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67164-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg00609.txt.bz2
Content-length: 490

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg164

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ldionne.2 at gmail dot com

--- Comment #2 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(Louis, this ICE was introduced by commit 8a0ddb0fa7b6f7a of
https://github.com/ldionne/hana)


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

* [Bug c++/67164] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
  2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
@ 2015-08-23 10:09 ` trippels at gcc dot gnu.org
  2015-08-27 19:53 ` ldionne.2 at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-08-23 10:09 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #3 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
Here's another testcase: 

namespace std {
template <typename _Tp> struct A { static constexpr _Tp value = 0; };
template <bool, typename, typename> struct conditional;
template <typename...> struct B;
template <typename _B1, typename _B2>
struct B<_B1, _B2> : conditional<1, _B1, _B2> {};
template <typename...> struct C;
template <typename _B1, typename _B2>
struct C<_B1, _B2> : conditional<1, _B2, _B1> {};
template <typename> struct D;
template <typename _Tp> struct I : B<A<bool>, D<_Tp>>::type {};
template <typename _Tp> _Tp declval();
struct F {
  template <typename _Tp, typename _Arg,
            typename = decltype(_Tp(declval<_Arg>()))>
  static A<bool> __test(int);
};
template <typename _Tp, typename _Arg> struct J : F {
  decltype(__test<_Tp, _Arg>(0)) type;
};
template <typename _Tp, typename _Arg> struct K : C<int, J<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct L : conditional<I<_Tp>::value, int, K<_Tp, _Arg>> {};
template <typename _Tp, typename _Arg>
struct __is_direct_constructible : L<_Tp, _Arg>::type {};
template <typename...> struct G;
template <typename _Tp, typename _Arg>
struct G<_Tp, _Arg> : __is_direct_constructible<_Tp, _Arg> {};
template <typename _Tp, typename... _Args>
struct is_constructible : G<_Tp, _Args...>::type {};
template <bool> struct enable_if;
template <bool, typename _Iftrue, typename> struct conditional {
  typedef _Iftrue type;
};
template <typename _Iftrue, typename _Iffalse>
struct conditional<false, _Iftrue, _Iffalse> {
  typedef _Iffalse type;
};
}
namespace detail {
template <bool> struct fast_and;
template <typename... Xn> struct closure {
  template <typename... Yn,
            typename = std::enable_if<
                fast_and<std::is_constructible<Xn, Yn>::value...>::value>>
  closure(Yn...);
  template <typename... Yn> closure(closure<Yn...>);
};
}
template <typename> struct make_impl;
template <typename Datatype> struct H {
  template <typename... X> decltype(auto) operator()(X... x) {
    return make_impl<Datatype>::apply(x...);
  }
};
template <typename Datatype> H<Datatype> make;
struct Tuple;
template <typename... Xs> struct M : detail::closure<Xs...> {
  using detail::closure<Xs...>::closure;
};
template <> struct make_impl<Tuple> {
  template <typename... Xs> static M<Xs...> apply(Xs...);
};
namespace test {
struct {
  template <typename... Xs> decltype(auto) operator()(Xs... xs) {
    auto storage = make<Tuple>(xs...);
    return storage;
  }
} seq;
}
int main() { test::seq(test::seq()); }


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

* [Bug c++/67164] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
  2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
  2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
@ 2015-08-27 19:53 ` ldionne.2 at gmail dot com
  2015-08-28  4:33 ` trippels at gcc dot gnu.org
  2021-10-01  9:48 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: ldionne.2 at gmail dot com @ 2015-08-27 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Louis Dionne <ldionne.2 at gmail dot com> ---
Still fails on trunk. Out of curiosity Markus, do you use software to reduce 
test cases? Did you generate these A, B, ... structs yourself?

Anyway, I was able to reduce to the following:

------------------------------------------------------------------------------
template <typename T>
T declval();

template <typename ...>
struct expand;

template <typename ...Xn>
struct closure {
    closure();

    template <typename ...Yn, typename = expand<
        decltype(Xn(declval<Yn>()))...
    >>
    closure(Yn ...);

    template <typename ...Yn>
    closure(closure<Yn...>);
};

int main() {
    closure<closure<>> empty{};
    closure<closure<>> copy(empty);
}
------------------------------------------------------------------------------


The command line and output (formatted to fit the report) are:

------------------------------------------------------------------------------
> ~/code/gcc/prefix/bin/g++ --version
g++ (GCC) 6.0.0 20150827 (experimental)

> ~/code/gcc/prefix/bin/g++ -std=c++14 test/worksheet.cpp
test/worksheet.cpp: In substitution of ‘
    template<class ... Yn> 
    closure<Xn>::closure(closure<Yn ...>) [with Yn = <missing>]’:

test/worksheet.cpp:1573:31:   required by substitution of ‘
    template<class ... Yn, class> 
    closure<Xn>::closure(Yn ...) [with Yn = closure<closure<> >; 
                                       <template-parameter-1-2> = <missing>]’

test/worksheet.cpp:1584:34:   required from here
test/worksheet.cpp:1573:31: internal compiler error: 
    tree check: expected class ‘expression’, have ‘exceptional’ 
    (argument_pack_select) in tree_operand_check, at tree.h:3356

     template <typename ...Yn, typename = expand<
                               ^
------------------------------------------------------------------------------
>From gcc-bugs-return-495756-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 27 20:56:02 2015
Return-Path: <gcc-bugs-return-495756-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25190 invoked by alias); 27 Aug 2015 20:56:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25031 invoked by uid 48); 27 Aug 2015 20:55:58 -0000
From: "l337.h4x0r at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/67375] New: abi::__cxa_demangle crashes demangling a lambda
Date: Thu, 27 Aug 2015 20:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: libstdc++
X-Bugzilla-Version: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: l337.h4x0r at gmail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone
Message-ID: <bug-67375-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg01898.txt.bz2
Content-length: 3045

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

            Bug ID: 67375
           Summary: abi::__cxa_demangle crashes demangling a lambda
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: l337.h4x0r at gmail dot com
  Target Milestone: ---

Here's how I reproduce this crash in __cxa_demangle:
-
$ cat test.cpp
#include <stdio.h>
#include <cxxabi.h>

int main()
{
  printf("%s\n",
abi::__cxa_demangle("_ZNSt9_AAA_AAAA9_M_bbbbbbIPZN5ccccc10DDDDDDDDDD20eeeeeeeeeeeeeeeeeeeeINS1_10FFFFFFFFFFEEEvRT_EUlvE_EES6_v",
NULL, NULL, NULL));
}

$ g++ -v
Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu
4.9.2-0ubuntu1~14.04' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs
--enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.9 --enable-shared --enable-linker-build-id
--libexecdir=/usr/lib --without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls
--with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify
--enable-plugin --with-system-zlib --disable-browser-plugin
--enable-java-awt=gtk --enable-gtk-cairo
--with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home
--with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64
--with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64
--with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar
--enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686
--with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-0ubuntu1~14.04)

$ g++ -o test test.cpp

$ gdb test
(gdb) run
(gdb) bt
...
#32477 0x00007ffff7b32c56 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32478 0x00007ffff7b30e04 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32479 0x00007ffff7b31019 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32480 0x00007ffff7b31473 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32481 0x00007ffff7b31019 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32482 0x00007ffff7b3269b in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32483 0x00007ffff7b32c56 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32484 0x00007ffff7b37266 in ?? () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32485 0x00007ffff7b374fa in __cxa_demangle () from
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#32486 0x0000000000400673 in main ()
–
>From gcc-bugs-return-495755-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Thu Aug 27 20:56:02 2015
Return-Path: <gcc-bugs-return-495755-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 25088 invoked by alias); 27 Aug 2015 20:56:02 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 25015 invoked by uid 48); 27 Aug 2015 20:55:56 -0000
From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/37021] Fortran Complex reduction / multiplication not vectorized
Date: Thu, 27 Aug 2015 20:56:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: tree-optimization
X-Bugzilla-Version: 4.4.0
X-Bugzilla-Keywords: alias, missed-optimization
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: wschmidt at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Resolution: FIXED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: rguenth at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 6.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-37021-4-ZSLRQzgUTv@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-37021-4@http.gcc.gnu.org/bugzilla/>
References: <bug-37021-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2015-08/txt/msg01897.txt.bz2
Content-length: 1727

https://gcc.gnu.org/bugzilla/show_bug.cgi?id7021

--- Comment #22 from Bill Schmidt <wschmidt at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #21)
> (In reply to Bill Schmidt from comment #20)

...<snip>...
>
> I see it only failing due to cost issues (tried ppc64le and -mcpu=power8).
> The unaligned loads cost 3 and we end up with
>
> t.f90:8:0: note: Cost model analysis:
>   Vector inside of loop cost: 40
>   Vector prologue cost: 8
>   Vector epilogue cost: 4
>   Scalar iteration cost: 12
>   Scalar outside cost: 6
>   Vector outside cost: 12
>   prologue iterations: 0
>   epilogue iterations: 0
> t.f90:8:0: note: cost model: the vector iteration cost = 40 divided by the
> scalar iteration cost = 12 is greater or equal to the vectorization factor > 1.
>
> Note that we are (still) not very good in estimating the SLP cost as we
> account 4 vector loads here (because we essentially will end up with
> 4 different permutations used), so the "unaligned" part is accounted for
> too much and likely the permutation cost as well.  Both are a limitation
> of the SLP data structures and not easily fixable.  With
> -fvect-cost-model=unlimited I see both loops vectorized.

Yes, I get these same results for the loop vectorizer (using -O2
-ftree-vectorize -mcpu=power8 -ffast-math).  But I was looking at the failure
to do SLP vectorization.  In comment 19 you indicated this was now working,
presumably on x86, but for Power we fail to SLP-vectorize
fast-math-pr37021.f90:9:0.

However, with today's trunk my SLP dump looks slightly different so I need to
have another look at whether this is still failing due to alignment or
something else.  I'll comment again when I've dug into it further.


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

* [Bug c++/67164] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
  2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
  2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
  2015-08-27 19:53 ` ldionne.2 at gmail dot com
@ 2015-08-28  4:33 ` trippels at gcc dot gnu.org
  2021-10-01  9:48 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: trippels at gcc dot gnu.org @ 2015-08-28  4:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Markus Trippelsdorf <trippels at gcc dot gnu.org> ---
(In reply to Louis Dionne from comment #4)
> Still fails on trunk. Out of curiosity Markus, do you use software to reduce 
> test cases? Did you generate these A, B, ... structs yourself?

I normally just use https://github.com/csmith-project/creduce .
But, as your testcase shows, you can sometimes reduce testcases further by
hand.


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

* [Bug c++/67164] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356
  2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-08-28  4:33 ` trippels at gcc dot gnu.org
@ 2021-10-01  9:48 ` pinskia at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-10-01  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |7.0

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

end of thread, other threads:[~2021-10-01  9:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-09  9:08 [Bug c++/67164] New: [6 Regression] ICE: tree check: expected class ‘expression’, have ‘exceptional’ (argument_pack_select) in tree_operand_check, at tree.h:3356 trippels at gcc dot gnu.org
2015-08-23 10:09 ` [Bug c++/67164] " trippels at gcc dot gnu.org
2015-08-27 19:53 ` ldionne.2 at gmail dot com
2015-08-28  4:33 ` trippels at gcc dot gnu.org
2021-10-01  9:48 ` pinskia 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).