Bug 66460 - ICE using __func__ in constexpr function.
Summary: ICE using __func__ in constexpr function.
Status: RESOLVED DUPLICATE of bug 70353
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 5.1.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 66292 66982 67176 69149 69812 69813 69814 (view as bug list)
Depends on:
Blocks: constexpr
  Show dependency treegraph
 
Reported: 2015-06-08 11:10 UTC by Jonathan Wakely
Modified: 2016-04-04 20:03 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2015-07-08 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Wakely 2015-06-08 11:10:03 UTC
constexpr char f() { return *__func__; }
constexpr char c = f();



pf.cc:2:21:   in constexpr expansion of ‘f()’
pf.cc:2:22: internal compiler error: Segmentation fault
 constexpr char c = f();
                      ^
0x10ab4173 crash_signal
        /home/jwakely/src/gcc/gcc/toplev.c:375
0x107394bc vec_safe_reserve<tree_node*, va_gc>
        /home/jwakely/src/gcc/gcc/vec.h:577
0x107394bc vec_safe_push<tree_node*, va_gc>
        /home/jwakely/src/gcc/gcc/vec.h:671
0x107394bc add_local_decl(function*, tree_node*)
        /home/jwakely/src/gcc/gcc/function.c:6702
0x10b4a293 remap_decls
        /home/jwakely/src/gcc/gcc/tree-inline.c:648
0x10b4b70f remap_block
        /home/jwakely/src/gcc/gcc/tree-inline.c:718
0x10b51c47 copy_bind_expr
        /home/jwakely/src/gcc/gcc/tree-inline.c:789
0x10b51c47 copy_tree_body_r(tree_node**, int*, void*)
        /home/jwakely/src/gcc/gcc/tree-inline.c:1123
0x10df0593 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*))
        /home/jwakely/src/gcc/gcc/tree.c:11182
0x10b42ddb copy_tree_body
        /home/jwakely/src/gcc/gcc/tree-inline.c:2959
0x10b548e3 copy_fn(tree_node*, tree_node*&, tree_node*&)
        /home/jwakely/src/gcc/gcc/tree-inline.c:5989
0x1044f3d7 cxx_eval_call_expression
        /home/jwakely/src/gcc/gcc/cp/constexpr.c:1353
0x10451567 cxx_eval_constant_expression
        /home/jwakely/src/gcc/gcc/cp/constexpr.c:3074
0x1045871b cxx_eval_outermost_constant_expr
        /home/jwakely/src/gcc/gcc/cp/constexpr.c:3577
0x1028326b store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>**, int)
        /home/jwakely/src/gcc/gcc/cp/typeck2.c:829
0x101cf907 check_initializer
        /home/jwakely/src/gcc/gcc/cp/decl.c:6024
0x101ff50f cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        /home/jwakely/src/gcc/gcc/cp/decl.c:6636
0x1032f163 cp_parser_init_declarator
        /home/jwakely/src/gcc/gcc/cp/parser.c:17320
0x103320c3 cp_parser_simple_declaration
        /home/jwakely/src/gcc/gcc/cp/parser.c:11612
0x10329a67 cp_parser_block_declaration
        /home/jwakely/src/gcc/gcc/cp/parser.c:11486
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
Comment 1 Paolo Carlini 2015-07-08 10:29:34 UTC
Stack trace very similar to c++/66292
Comment 2 Markus Trippelsdorf 2015-08-10 16:11:13 UTC
*** Bug 66292 has been marked as a duplicate of this bug. ***
Comment 3 Markus Trippelsdorf 2015-08-10 16:11:41 UTC
*** Bug 67176 has been marked as a duplicate of this bug. ***
Comment 4 Marek Polacek 2015-12-07 16:01:44 UTC
Started with r217663.
Comment 5 Markus Trippelsdorf 2015-12-13 17:03:28 UTC
*** Bug 66982 has been marked as a duplicate of this bug. ***
Comment 6 Markus Trippelsdorf 2016-01-05 18:38:34 UTC
*** Bug 69149 has been marked as a duplicate of this bug. ***
Comment 7 Markus Trippelsdorf 2016-02-14 06:32:26 UTC
*** Bug 69813 has been marked as a duplicate of this bug. ***
Comment 8 Markus Trippelsdorf 2016-02-14 08:13:31 UTC
*** Bug 69814 has been marked as a duplicate of this bug. ***
Comment 9 Markus Trippelsdorf 2016-02-14 08:13:43 UTC
*** Bug 69812 has been marked as a duplicate of this bug. ***
Comment 10 Martin Sebor 2016-04-04 20:03:14 UTC
Bug 70353 is a duplicate of this one.  Although this report predates the latter, I'm closing this one since 70353 is the one the fix for 6.0 has been committed under.

*** This bug has been marked as a duplicate of bug 70353 ***