[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 --- Comment #9 from Jakub Jelinek --- Author: jakub Date: Fri Mar 16 12:46:12 2018 New Revision: 258593 URL: https://gcc.gnu.org/viewcvs?rev=258593&root=gcc&view=rev Log: PR c++/79937 PR c++/82410 * tree.h (TARGET_EXPR_NO_ELIDE): Define. * gimplify.c (gimplify_modify_expr_rhs): Don't elide TARGET_EXPRs with TARGET_EXPR_NO_ELIDE flag set unless *expr_p is INIT_EXPR. * cp-tree.h (CONSTRUCTOR_PLACEHOLDER_BOUNDARY): Define. (find_placeholder): Declare. * tree.c (struct replace_placeholders_t): Add exp member. (replace_placeholders_r): Don't walk into ctors with CONSTRUCTOR_PLACEHOLDER_BOUNDARY flag set, unless they are equal to d->exp. Replace PLACEHOLDER_EXPR with unshare_expr (x) rather than x. (replace_placeholders): Initialize data.exp. (find_placeholders_r, find_placeholders): New functions. * typeck2.c (process_init_constructor_record, process_init_constructor_union): Set CONSTRUCTOR_PLACEHOLDER_BOUNDARY if adding NSDMI on which find_placeholder returns true. * call.c (build_over_call): Don't call replace_placeholders here. * cp-gimplify.c (cp_genericize_r): Set TARGET_EXPR_NO_ELIDE on TARGET_EXPRs with CONSTRUCTOR_PLACEHOLDER_BOUNDARY set on TARGET_EXPR_INITIAL. (cp_fold): Copy over CONSTRUCTOR_PLACEHOLDER_BOUNDARY bit to new ctor. * g++.dg/cpp1y/pr79937-1.C: New test. * g++.dg/cpp1y/pr79937-2.C: New test. * g++.dg/cpp1y/pr79937-3.C: New test. * g++.dg/cpp1y/pr79937-4.C: New test. * g++.dg/cpp1y/pr82410.C: New test. Added: trunk/gcc/testsuite/g++.dg/cpp1y/pr79937-1.C trunk/gcc/testsuite/g++.dg/cpp1y/pr79937-2.C trunk/gcc/testsuite/g++.dg/cpp1y/pr79937-3.C trunk/gcc/testsuite/g++.dg/cpp1y/pr79937-4.C trunk/gcc/testsuite/g++.dg/cpp1y/pr82410.C Modified: trunk/gcc/ChangeLog trunk/gcc/cp/ChangeLog trunk/gcc/cp/call.c trunk/gcc/cp/cp-gimplify.c trunk/gcc/cp/cp-tree.h trunk/gcc/cp/tree.c trunk/gcc/cp/typeck2.c trunk/gcc/gimplify.c trunk/gcc/testsuite/ChangeLog trunk/gcc/tree.h
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Jason Merrill changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |DUPLICATE --- Comment #8 from Jason Merrill --- It really is the same issue. *** This bug has been marked as a duplicate of bug 79937 ***
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Richard Biener changed: What|Removed |Added Target Milestone|7.3 |7.4 --- Comment #7 from Richard Biener --- GCC 7.3 is being released, adjusting target milestone.
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Markus Trippelsdorf changed: What|Removed |Added CC||jeanmichael.celerier@gmail. ||com --- Comment #6 from Markus Trippelsdorf --- *** Bug 83630 has been marked as a duplicate of this bug. ***
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #5 from Jakub Jelinek --- It is the "nor whether SUB is a CONSTRUCTOR." part of the patch that causes this. The PLACEHOLDER_EXPR's type is S, while the VAR_DECL passed as second argument to replace_placeholders is a temporary with A type. sub is: main()::S::operator main()::A (&TARGET_EXPR )->p}>); Don't know replace_placeholders enough to fix this myself.
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 gcc-bugs at marehr dot dialup.fu-berlin.de changed: What|Removed |Added CC||gcc-bugs at marehr dot dialup.fu-b ||erlin.de --- Comment #4 from gcc-bugs at marehr dot dialup.fu-berlin.de --- I (may) have run into the same issue: ``` template struct twice { value_t _first{}; value_t _second{_first}; struct inner{}; inner get() const { return inner{}; } }; template twice(value_t first) -> twice; int main() { auto result = twice{0u}.get(); } ```
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Richard Biener changed: What|Removed |Added Priority|P3 |P2 Target Milestone|--- |7.3
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 --- Comment #3 from Paolo Carlini --- Thanks. Better leaving Marek in CC anyway ;)
[Bug c++/82410] [7/8 Regression] ICE in replace_placeholders_r
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82410 Martin Liška changed: What|Removed |Added Keywords||ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed||2017-10-03 CC||marxin at gcc dot gnu.org Summary|ICE in |[7/8 Regression] ICE in |replace_placeholders_r |replace_placeholders_r Ever confirmed|0 |1 --- Comment #2 from Martin Liška --- It's probably a different issue (maybe). This one started with r246772.