* [Bug c++/65525] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
@ 2015-03-24 10:23 ` rguenth at gcc dot gnu.org
2015-03-24 10:25 ` rguenth at gcc dot gnu.org
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-24 10:23 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
Richard Biener <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-03-24
Ever confirmed|0 |1
--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
Confirmed.
Btw, I wonder why we sorry here instead of simply treating it as
non-constant...
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
2015-03-24 10:23 ` [Bug c++/65525] " rguenth at gcc dot gnu.org
@ 2015-03-24 10:25 ` rguenth at gcc dot gnu.org
2015-03-24 10:29 ` rguenth at gcc dot gnu.org
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-24 10:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
Run till exit from #0 0x00000000012bf93a in build2_stat (code=MEM_REF,
tt=<array_type 0x7ffff6a35f18>, arg0=<addr_expr 0x7ffff6a39760>,
arg1=<integer_cst 0x7ffff6a33228>)
at /space/rguenther/src/svn/trunk/gcc/tree.c:4385
0x00000000006f8b40 in build_over_call (cand=0x24f7aa0, flags=1, complain=3)
at /space/rguenther/src/svn/trunk/gcc/cp/call.c:7456
7456 t = build2 (MODIFY_EXPR, void_type_node,
Value returned is $9 = (tree_node *) 0x7ffff6a37758
(gdb) l
7451 array_type = build_array_type (char_type_node,
7452 build_index_type
7453 (size_binop (MINUS_EXPR,
7454 arg2, size_int
(1))));
7455 alias_set = build_int_cst (build_pointer_type (type), 0);
7456 t = build2 (MODIFY_EXPR, void_type_node,
7457 build2 (MEM_REF, array_type, arg0, alias_set),
7458 build2 (MEM_REF, array_type, arg, alias_set));
7459 val = build2 (COMPOUND_EXPR, TREE_TYPE (to), t, to);
so the C++ FE even builds this itself.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
2015-03-24 10:23 ` [Bug c++/65525] " rguenth at gcc dot gnu.org
2015-03-24 10:25 ` rguenth at gcc dot gnu.org
@ 2015-03-24 10:29 ` rguenth at gcc dot gnu.org
2015-03-26 16:21 ` [Bug c++/65525] [5 Regression] " jason at gcc dot gnu.org
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: rguenth at gcc dot gnu.org @ 2015-03-24 10:29 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Ah, and that was me:
2011-08-12 Richard Guenther <rguenther@suse.de>
* call.c (build_over_call): Instead of memcpy use an
assignment of two MEM_REFs.
which implements memcpy as *(char[n])ptr1 = *(char[n])ptr2;
But we ask
#4 0x000000000097fdb9 in potential_rvalue_constant_expression (
t=<compound_expr 0x7ffff6a377a8>)
at /space/rguenther/src/svn/trunk/gcc/cp/constexpr.c:4478
(gdb) p debug_generic_expr (expression)
MEM[(struct A *)&y] = MEM[(struct A *)(const struct A &) (const struct A *)
&a];, y
so I wonder why we look at the side-effects at all? That is, why does
COMPOUND_EXPR handling not return false on side-effects early?
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] [5 Regression] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
` (2 preceding siblings ...)
2015-03-24 10:29 ` rguenth at gcc dot gnu.org
@ 2015-03-26 16:21 ` jason at gcc dot gnu.org
2015-03-26 18:25 ` jason at gcc dot gnu.org
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-26 16:21 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
CC| |jason at gcc dot gnu.org
Assignee|unassigned at gcc dot gnu.org |jason at gcc dot gnu.org
--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #3)
> so I wonder why we look at the side-effects at all? That is, why does
> COMPOUND_EXPR handling not return false on side-effects early?
Because a call to a constexpr function has TREE_SIDE_EFFECTS; we don't know
whether it's constant until we do the evaluation.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] [5 Regression] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
` (3 preceding siblings ...)
2015-03-26 16:21 ` [Bug c++/65525] [5 Regression] " jason at gcc dot gnu.org
@ 2015-03-26 18:25 ` jason at gcc dot gnu.org
2015-03-26 18:31 ` jason at gcc dot gnu.org
2015-03-27 10:06 ` rogero at howzatt dot demon.co.uk
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-26 18:25 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
Jason Merrill <jason at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution|--- |FIXED
Target Milestone|--- |5.0
--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] [5 Regression] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
` (4 preceding siblings ...)
2015-03-26 18:25 ` jason at gcc dot gnu.org
@ 2015-03-26 18:31 ` jason at gcc dot gnu.org
2015-03-27 10:06 ` rogero at howzatt dot demon.co.uk
6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2015-03-26 18:31 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Thu Mar 26 17:58:39 2015
New Revision: 221699
URL: https://gcc.gnu.org/viewcvs?rev=221699&root=gcc&view=rev
Log:
PR c++/65525
* constexpr.c (potential_constant_expression_1): Handle MEM_REF.
Added:
trunk/gcc/testsuite/g++.dg/parse/assign1.C
Modified:
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/constexpr.c
^ permalink raw reply [flat|nested] 8+ messages in thread
* [Bug c++/65525] [5 Regression] ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432)
2015-03-23 16:49 [Bug c++/65525] New: ICE: sorry, unimplemented: unexpected AST of kind mem_ref (-std=c++14, ICE: in potential_constant_expression_1, at cp/constexpr.c:4432) marciso.gcc at gmail dot com
` (5 preceding siblings ...)
2015-03-26 18:31 ` jason at gcc dot gnu.org
@ 2015-03-27 10:06 ` rogero at howzatt dot demon.co.uk
6 siblings, 0 replies; 8+ messages in thread
From: rogero at howzatt dot demon.co.uk @ 2015-03-27 10:06 UTC (permalink / raw)
To: gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65525
--- Comment #7 from Roger Orr <rogero at howzatt dot demon.co.uk> ---
Thanks!
^ permalink raw reply [flat|nested] 8+ messages in thread