[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 --- Comment #6 from Jason Merrill --- Author: jason Date: Thu Feb 16 16:42:06 2017 New Revision: 245511 URL: https://gcc.gnu.org/viewcvs?rev=245511=gcc=rev Log: PR c++/78572 - ICE with self-modifying array initializer * constexpr.c (cxx_eval_store_expression): The object we're initializing is outside the constant-expression. Added: trunk/gcc/testsuite/g++.dg/init/array47.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/constexpr.c
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Jason Merrill changed: What|Removed |Added Status|NEW |ASSIGNED Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Marek Polacek changed: What|Removed |Added CC||mpolacek at gcc dot gnu.org --- Comment #5 from Marek Polacek --- Bug 78897 might be a dup of this.
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Jakub Jelinek changed: What|Removed |Added Target Milestone|6.3 |6.4 --- Comment #4 from Jakub Jelinek --- GCC 6.3 is being released, adjusting target milestone.
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Aldy Hernandez changed: What|Removed |Added CC||aldyh at gcc dot gnu.org Assignee|unassigned at gcc dot gnu.org |aldyh at gcc dot gnu.org --- Comment #3 from Aldy Hernandez --- I'll take a stab.
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Richard Biener changed: What|Removed |Added Priority|P3 |P2
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org, ||jason at gcc dot gnu.org --- Comment #2 from Jakub Jelinek --- But this isn't a designed array initializer, it is a normal initializer with side-effects in it. And presumably the C++ FE lowered that into {[3]=5, [0]=5, [7]=3, [1]=3} which is considered invalid by the middle-end, since it isn't sorted by increasing index. With static int array[10] = { array[3]=5, array[7]=3, array[7]=8, array[7] = 9 }; it is even worse, we get {[3]=5, [0]=5, [7]=9, [1]=3, [2]=8, [3]=9} so [3] is written twice. Not sure if this isn't undefined behavior (I hope it is), but still we shouldn't ICE on it, best would be not to turn the stores into CONSTRUCTOR elements, but just handle the side-effects at runtime.
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Richard Biener changed: What|Removed |Added Target Milestone|--- |6.3
[Bug c++/78572] [6/7 Regression] internal compiler error: in output_constructor_regular_field, at varasm.c:4968
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78572 Martin Sebor changed: What|Removed |Added Keywords||ice-on-valid-code Status|UNCONFIRMED |NEW Last reconfirmed||2016-11-29 CC||msebor at gcc dot gnu.org Summary|internal compiler error: in |[6/7 Regression] internal |output_constructor_regular_ |compiler error: in |field, at varasm.c:4968 |output_constructor_regular_ ||field, at varasm.c:4968 Ever confirmed|0 |1 Known to fail||6.2.0, 7.0 --- Comment #1 from Martin Sebor --- Confirmed. Bisection points to r234636 as the change that caused it. Looks like it's a 6/7 regression, though designated initializers don't fully work in G++. (gcc 6.0.0) failed (status 4): r234636 | nathan | 2016-03-31 11:30:33 -0400 (Thu, 31 Mar 2016) | 11 lines PR c++/70393 * varasm.c (output_constructor_regular_field): Flush bitfield earlier. Assert we don't want to move backwards. cp/ * constexpr.c (cxx_eval_store_expression): Keep CONSTRUCTOR elements in field order. testsuite/ * g++.dg/cpp0x/constexpr-virtual6.C: New. The full stack trace is below: t.C:7:1: internal compiler error: in output_constructor_regular_field, at varasm.c:4989 } ^ 0x148b5bf output_constructor_regular_field ../../gcc/varasm.c:4989 0x148c3a5 output_constructor ../../gcc/varasm.c:5297 0x148aaf4 output_constant ../../gcc/varasm.c:4794 0x1482165 assemble_variable_contents ../../gcc/varasm.c:2083 0x1482bbf assemble_variable(tree_node*, int, int, int) ../../gcc/varasm.c:2259 0x149a0bc varpool_node::assemble_decl() ../../gcc/varpool.c:588 0xbab20d output_in_order ../../gcc/cgraphunit.c:2248 0xbab8d2 symbol_table::compile() ../../gcc/cgraphunit.c:2488 0xbabb1b symbol_table::finalize_compilation_unit() ../../gcc/cgraphunit.c:2584 Please submit a full bug report,