* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
@ 2022-10-14 16:25 ` dcb314 at hotmail dot com
2022-10-14 16:29 ` dcb314 at hotmail dot com
` (14 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-14 16:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #1 from David Binderman <dcb314 at hotmail dot com> ---
The compiler first seems to break sometime between git hash 8a9e92b249c9c5a5
and 6ffbf87ca66f4ed9, a day later.
Reduction running.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
2022-10-14 16:25 ` [Bug c++/107267] " dcb314 at hotmail dot com
@ 2022-10-14 16:29 ` dcb314 at hotmail dot com
2022-10-15 11:00 ` dcb314 at hotmail dot com
` (13 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-14 16:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #2 from David Binderman <dcb314 at hotmail dot com> ---
There is only one mention of cp_gimplify_init_expr in that git
range, and it is the final commit of Jason's, marked
6ffbf87ca66f4ed9cd79cff675fabe2109e46e85.
Not a smoking gun, but possibly a lead candidate.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
2022-10-14 16:25 ` [Bug c++/107267] " dcb314 at hotmail dot com
2022-10-14 16:29 ` dcb314 at hotmail dot com
@ 2022-10-15 11:00 ` dcb314 at hotmail dot com
2022-10-16 6:39 ` dcb314 at hotmail dot com
` (12 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-15 11:00 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #3 from David Binderman <dcb314 at hotmail dot com> ---
Reduced C++ code is
template <int __v> struct integral_constant {
static constexpr int value = __v;
};
template <bool __v> using __bool_constant = integral_constant<__v>;
template <int> struct __conditional {
template <typename _Tp, typename> using type = _Tp;
};
template <bool _Cond, typename _If, typename _Else>
using __conditional_t = typename __conditional<_Cond>::type<_If, _Else>;
template <typename _Tp> struct remove_reference { using type = _Tp; };
namespace std {
template <typename _Tp> typename remove_reference<_Tp>::type &&move(_Tp &&);
struct pair {
int second;
};
template <int _Constant_iterators> struct _Hashtable_traits {
using __constant_iterators = __bool_constant<_Constant_iterators>;
};
template <int __constant_iterators> struct _Node_iterator {
using value_type = pair;
using pointer =
__conditional_t<__constant_iterators, value_type *, value_type>;
pointer operator->();
};
struct _Insert_base {
using __constant_iterators = _Hashtable_traits<false>::__constant_iterators;
using iterator = _Node_iterator<__constant_iterators::value>;
};
template <typename, typename> using __umap_hashtable = _Insert_base;
struct unordered_map {
__umap_hashtable<int, int>::iterator find(int);
};
} // namespace std
template <typename, typename> using unordered_map = std::unordered_map;
struct vl_concurrent_unordered_map {
struct FindResult {
FindResult(bool, int);
std::pair result;
};
int pop_key;
void pop() {
auto itr = maps[0].find(pop_key);
auto ret = std::move(FindResult(true, itr->second));
}
unordered_map<int, int> maps[];
} unique_id_mapping;
void DispatchDestroyAccelerationStructureKHR() { unique_id_mapping.pop(); }
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (2 preceding siblings ...)
2022-10-15 11:00 ` dcb314 at hotmail dot com
@ 2022-10-16 6:39 ` dcb314 at hotmail dot com
2022-10-16 7:03 ` dcb314 at hotmail dot com
` (11 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-16 6:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #4 from David Binderman <dcb314 at hotmail dot com> ---
Trying a git bisect with git hash 93b3ab6c0c6a44df.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (3 preceding siblings ...)
2022-10-16 6:39 ` dcb314 at hotmail dot com
@ 2022-10-16 7:03 ` dcb314 at hotmail dot com
2022-10-16 7:21 ` dcb314 at hotmail dot com
` (10 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-16 7:03 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #5 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #4)
> Trying a git bisect with git hash 93b3ab6c0c6a44df.
Seems good. Trying eb491ea5c10955c6.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (4 preceding siblings ...)
2022-10-16 7:03 ` dcb314 at hotmail dot com
@ 2022-10-16 7:21 ` dcb314 at hotmail dot com
2022-10-16 7:30 ` dcb314 at hotmail dot com
` (9 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-16 7:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #6 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to David Binderman from comment #5)
> (In reply to David Binderman from comment #4)
> > Trying a git bisect with git hash 93b3ab6c0c6a44df.
>
> Seems good. Trying eb491ea5c10955c6.
Seems good. Trying b9ad850e86b863c2.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (5 preceding siblings ...)
2022-10-16 7:21 ` dcb314 at hotmail dot com
@ 2022-10-16 7:30 ` dcb314 at hotmail dot com
2022-10-17 11:31 ` [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9 marxin at gcc dot gnu.org
` (8 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-16 7:30 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
David Binderman <dcb314 at hotmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #7 from David Binderman <dcb314 at hotmail dot com> ---
Advice of Jason sought.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (6 preceding siblings ...)
2022-10-16 7:30 ` dcb314 at hotmail dot com
@ 2022-10-17 11:31 ` marxin at gcc dot gnu.org
2022-10-17 11:32 ` marxin at gcc dot gnu.org
` (7 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-17 11:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Last reconfirmed| |2022-10-17
Summary|ice in |[13 Regression] ICE in
|cp_gimplify_init_expr, at |cp_gimplify_init_expr, at
|cp/cp-gimplify.cc:253 |cp/cp-gimplify.cc:253 since
| |r13-3175-g6ffbf87ca66f4ed9
Ever confirmed|0 |1
Status|UNCONFIRMED |NEW
CC| |marxin at gcc dot gnu.org
Keywords|ice-on-valid-code, |rejects-valid
|needs-bisection |
--- Comment #8 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r13-3175-g6ffbf87ca66f4ed9.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (7 preceding siblings ...)
2022-10-17 11:31 ` [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9 marxin at gcc dot gnu.org
@ 2022-10-17 11:32 ` marxin at gcc dot gnu.org
2022-10-17 11:35 ` marxin at gcc dot gnu.org
` (6 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-17 11:32 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|--- |13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (8 preceding siblings ...)
2022-10-17 11:32 ` marxin at gcc dot gnu.org
@ 2022-10-17 11:35 ` marxin at gcc dot gnu.org
2022-10-17 11:35 ` marxin at gcc dot gnu.org
` (5 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-17 11:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #9 from Martin Liška <marxin at gcc dot gnu.org> ---
More reduced test-case:
template <int __v> struct integral_constant {
static constexpr int value = __v;
};
template <bool __v> using __bool_constant = integral_constant<__v>;
template <int> struct __conditional {
template <typename _Tp, typename> using type = _Tp;
};
template <bool _Cond, typename _If, typename _Else>
using __conditional_t = typename __conditional<_Cond>::type<_If, _Else>;
namespace std {
template <typename _Tp> _Tp &&move(_Tp &&);
struct pair {
int second;
};
template <int _Constant_iterators> struct _Hashtable_traits {
using __constant_iterators = __bool_constant<_Constant_iterators>;
};
template <int __constant_iterators> struct _Node_iterator {
__conditional_t<__constant_iterators, pair *, pair> operator->();
};
using iterator =
_Node_iterator<_Hashtable_traits<false>::__constant_iterators::value>;
} // namespace std
struct FindResult {
FindResult(bool, int);
std::pair result;
};
std::iterator pop_itr;
FindResult pop_ret = std::move(FindResult(true, pop_itr->second));
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (9 preceding siblings ...)
2022-10-17 11:35 ` marxin at gcc dot gnu.org
@ 2022-10-17 11:35 ` marxin at gcc dot gnu.org
2022-10-20 18:39 ` dcb314 at hotmail dot com
` (4 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: marxin at gcc dot gnu.org @ 2022-10-17 11:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Martin Liška <marxin at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Priority|P3 |P1
Version|12.0 |13.0
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (10 preceding siblings ...)
2022-10-17 11:35 ` marxin at gcc dot gnu.org
@ 2022-10-20 18:39 ` dcb314 at hotmail dot com
2022-10-20 18:52 ` ppalka at gcc dot gnu.org
` (3 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: dcb314 at hotmail dot com @ 2022-10-20 18:39 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #10 from David Binderman <dcb314 at hotmail dot com> ---
(In reply to Martin Liška from comment #8)
> Started with r13-3175-g6ffbf87ca66f4ed9.
So maybe it would be a good idea to assign this bug to Jason ?
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (11 preceding siblings ...)
2022-10-20 18:39 ` dcb314 at hotmail dot com
@ 2022-10-20 18:52 ` ppalka at gcc dot gnu.org
2023-01-23 22:04 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
15 siblings, 0 replies; 17+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-10-20 18:52 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #11 from Patrick Palka <ppalka at gcc dot gnu.org> ---
FWIW -ffold-simple-inline is sufficient to trigger the ICE, so this has
something to do with cp_fold's folding of std::move. More reduced:
$ cat 107267.C
namespace std {
template<typename _Tp> _Tp &&move(_Tp &&);
}
struct FindResult {
FindResult();
int result;
};
FindResult pop_ret = std::move(FindResult());
$ g++ -ffold-simple-inlines 107267.C
107267.C:10:44: internal compiler error: in cp_gimplify_init_expr, at
cp/cp-gimplify.cc:253
10 | FindResult pop_ret = std::move(FindResult());
| ^
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (12 preceding siblings ...)
2022-10-20 18:52 ` ppalka at gcc dot gnu.org
@ 2023-01-23 22:04 ` jason at gcc dot gnu.org
2023-01-23 23:35 ` cvs-commit at gcc dot gnu.org
2023-01-24 2:53 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2023-01-23 22:04 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (13 preceding siblings ...)
2023-01-23 22:04 ` jason at gcc dot gnu.org
@ 2023-01-23 23:35 ` cvs-commit at gcc dot gnu.org
2023-01-24 2:53 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-01-23 23:35 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
--- Comment #12 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:
https://gcc.gnu.org/g:4cbc71691e47b1ca6b64feb0af678606705d2f92
commit r13-5316-g4cbc71691e47b1ca6b64feb0af678606705d2f92
Author: Jason Merrill <jason@redhat.com>
Date: Mon Jan 23 17:14:11 2023 -0500
c++: TARGET_EXPR_ELIDING_P and std::move [PR107267]
With -ffold-simple-inlines, we turn calls to std::move into the static_cast
equivalent. In this testcase, this exposes the FindResult temporary to
copy
elision which is not specified by the standard, through an optimization in
gimplify_modify_expr_rhs. Since the type is not TREE_ADDRESSABLE, this is
not detectable by the user, so we just need to soften the assert.
PR c++/107267
gcc/cp/ChangeLog:
* cp-gimplify.cc (cp_gimplify_init_expr): Allow unexpected elision
of trivial types.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/move2.C: New test.
^ permalink raw reply [flat|nested] 17+ messages in thread
* [Bug c++/107267] [13 Regression] ICE in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 since r13-3175-g6ffbf87ca66f4ed9
2022-10-14 16:18 [Bug c++/107267] New: ice in cp_gimplify_init_expr, at cp/cp-gimplify.cc:253 dcb314 at hotmail dot com
` (14 preceding siblings ...)
2023-01-23 23:35 ` cvs-commit at gcc dot gnu.org
@ 2023-01-24 2:53 ` jason at gcc dot gnu.org
15 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2023-01-24 2:53 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107267
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |FIXED
Status|ASSIGNED |RESOLVED
--- Comment #13 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 17+ messages in thread