[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Jason Merrill  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Jason Merrill  ---
Fixed.

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

--- Comment #7 from Jason Merrill  ---
Author: jason
Date: Tue Feb 27 04:22:31 2018
New Revision: 258028

URL: https://gcc.gnu.org/viewcvs?rev=258028&root=gcc&view=rev
Log:
PR c++/84441 - ICE with base initialized from ?:

* call.c (unsafe_copy_elision_p): Handle COND_EXPR.

Added:
branches/gcc-6-branch/gcc/testsuite/g++.dg/cpp0x/elision3.C
Modified:
branches/gcc-6-branch/gcc/cp/ChangeLog
branches/gcc-6-branch/gcc/cp/call.c

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

--- Comment #5 from Jason Merrill  ---
Author: jason
Date: Tue Feb 27 02:47:31 2018
New Revision: 258025

URL: https://gcc.gnu.org/viewcvs?rev=258025&root=gcc&view=rev
Log:
PR c++/84441 - ICE with base initialized from ?:

* call.c (unsafe_copy_elision_p): Handle COND_EXPR.

Added:
branches/gcc-7-branch/gcc/testsuite/g++.dg/cpp0x/elision3.C
Modified:
branches/gcc-7-branch/gcc/cp/ChangeLog
branches/gcc-7-branch/gcc/cp/call.c

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

--- Comment #4 from Jason Merrill  ---
Author: jason
Date: Tue Feb 27 02:45:12 2018
New Revision: 258022

URL: https://gcc.gnu.org/viewcvs?rev=258022&root=gcc&view=rev
Log:
PR c++/84441 - ICE with base initialized from ?:

* call.c (unsafe_copy_elision_p): Handle COND_EXPR.

Added:
trunk/gcc/testsuite/g++.dg/cpp0x/elision3.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/call.c

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-26 Thread jason at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Jason Merrill  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED
   Assignee|unassigned at gcc dot gnu.org  |jason at gcc dot gnu.org

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Jakub Jelinek  changed:

   What|Removed |Added

   Priority|P3  |P2
 CC||jason at gcc dot gnu.org

--- Comment #3 from Jakub Jelinek  ---
Further reduced:
int &foo ();
struct A { struct B { B (int *, int &); int *b; } a; A (A &&) : a (0, foo ())
{} };
struct C { A c; int d; };
C bar ();
struct D : C { D () : C (0 ? bar () : bar ()) {} };
D d;

The problem is when expanding this_2(D)->D.2434 = bar ();, where both lhs and
rhs
have TREE_ADDRESSABLE type, but type of bar () return value is C, which has
128-bit size, and type of the lhs - COMPONENT_REF - is also C, 128-bit, but its
second operand is a 96-bit FIELD_DECL instead (C without the padding at the
end).

When using C (bar ()) instead of C (0 ? bar () : bar ()) it compiles fine, but
in that case bar () is not called with the COMPONENT_REF with 96-bit FIELD_DECL
on lhs, but instead a C temporary that is later on copy constructed into the
96-bit FIELD_DECL.  So, it feels more like a C++ FE bug than something the
expansion needs to handle, but I could be wrong.

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-19 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Jakub Jelinek  changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org
   Target Milestone|--- |6.5

--- Comment #2 from Jakub Jelinek  ---
Reduced testcase:
struct A;
struct B { using C = int *; template  using D = A; };
struct F : B { struct G { typedef D h; }; };
struct I {
  struct J { J (F::C, A &); F::C k; } l;
  F::G::h &foo ();
  I (I &&) : l (0, foo ()) {}
};
struct N { I o; int e; };
N bar ();
struct E : N { E () : N (0 ? bar () : bar ()) {} };

void
baz ()
{
  E ();
}

[Bug c++/84441] [6/7/8 Regression] Internal compiler error

2018-02-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84441

Martin Sebor  changed:

   What|Removed |Added

   Keywords||ice-on-valid-code
 Status|UNCONFIRMED |NEW
   Last reconfirmed||2018-02-19
 CC||msebor at gcc dot gnu.org
Summary|Internal compiler error |[6/7/8 Regression] Internal
   ||compiler error
 Ever confirmed|0   |1

--- Comment #1 from Martin Sebor  ---
Confirmed with the top of trunk and the stack trace below:

during RTL pass: expand
pr84441.C: In constructor ‘derived::derived(int)’:
pr84441.C:17:15: internal compiler error: in assign_temp, at function.c:977
 (size_t)0-n ) ) { }
   ^
0xe756e6 assign_temp(tree_node*, int, int)
/ssd/src/gcc/svn/gcc/function.c:977
0xc3ab15 expand_call(tree_node*, rtx_def*, int)
/ssd/src/gcc/svn/gcc/calls.c:3434
0xe0b3ee expand_expr_real_1(tree_node*, rtx_def*, machine_mode,
expand_modifier, rtx_def**, bool)
/ssd/src/gcc/svn/gcc/expr.c:10990
0xdfd6d6 expand_expr_real(tree_node*, rtx_def*, machine_mode, expand_modifier,
rtx_def**, bool)
/ssd/src/gcc/svn/gcc/expr.c:8227
0xdda6ba expand_normal
/ssd/src/gcc/svn/gcc/expr.h:282
0xdf8521 store_field
/ssd/src/gcc/svn/gcc/expr.c:6975
0xdefba7 expand_assignment(tree_node*, tree_node*, bool)
/ssd/src/gcc/svn/gcc/expr.c:5249
0xc59426 expand_call_stmt
/ssd/src/gcc/svn/gcc/cfgexpand.c:2688
0xc5c911 expand_gimple_stmt_1
/ssd/src/gcc/svn/gcc/cfgexpand.c:3624
0xc5d044 expand_gimple_stmt
/ssd/src/gcc/svn/gcc/cfgexpand.c:3790
0xc65757 expand_gimple_basic_block
/ssd/src/gcc/svn/gcc/cfgexpand.c:5819
0xc67357 execute
/ssd/src/gcc/svn/gcc/cfgexpand.c:6425
Please submit a full bug report,
with preprocessed source if appropriate.


The first revision to fail is r228704 (gcc 6.0.0):

r228704 | jason | 2015-10-12 03:58:43 -0400 (Mon, 12 Oct 2015) | 5 lines

PR c++/67557