public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/59646] New: [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
@ 2013-12-31  0:24 reichelt at gcc dot gnu.org
  2014-01-07 11:54 ` [Bug c++/59646] " rguenth at gcc dot gnu.org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-12-31  0:24 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59646

            Bug ID: 59646
           Summary: [4.7/4.8/4.9 Regression] ICE with volatile in
                    initializer list
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following (invalid?) code snippet triggers an ICE since GCC 4.7.0:

===========================================================
#include <initializer_list>

struct A {};

std::initializer_list<volatile A> x = {{}};
===========================================================

bug.cc:5:42: error: no matching function for call to 'A::A(volatile A)'
 std::initializer_list<volatile A> x = {{}};
                                          ^
bug.cc:5:42: note: candidates are:
bug.cc:3:8: note: constexpr A::A()
 struct A {};
        ^
bug.cc:3:8: note:   candidate expects 0 arguments, 1 provided
bug.cc:3:8: note: constexpr A::A(const A&)
bug.cc:3:8: note:   no known conversion for argument 1 from 'volatile A' to
'const A&'
bug.cc:3:8: note: constexpr A::A(A&&)
bug.cc:3:8: note:   no known conversion for argument 1 from 'volatile A' to
'A&&'
bug.cc: In function 'void __static_initialization_and_destruction_0(int, int)':
bug.cc:5:42: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in useless_type_conversion_p, at gimple-expr.c:80
 std::initializer_list<volatile A> x = {{}};
                                          ^
0xd8f855 tree_class_check_failed(tree_node const*, tree_code_class, char
const*, int, char const*)
        ../../gcc/gcc/tree.c:9243
0x9a5f05 tree_class_check
        ../../gcc/gcc/tree.h:2830
0x9a5f05 useless_type_conversion_p(tree_node*, tree_node*)
        ../../gcc/gcc/gimple-expr.c:80
0x9d2cf9 gimplify_modify_expr
        ../../gcc/gcc/gimplify.c:4446
0x9c72fc gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7431
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9c74ec gimplify_cleanup_point_expr
        ../../gcc/gcc/gimplify.c:5110
0x9c74ec gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7787
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9c7aab gimplify_statement_list
        ../../gcc/gcc/gimplify.c:1405
0x9c7aab gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7839
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9cf6d3 gimplify_cond_expr
        ../../gcc/gcc/gimplify.c:3052
0x9c7333 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7387
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9cf6d3 gimplify_cond_expr
        ../../gcc/gcc/gimplify.c:3052
0x9c7333 gimplify_expr(tree_node**, gimple_statement_base**,
gimple_statement_base**, bool (*)(tree_node*), int)
        ../../gcc/gcc/gimplify.c:7387
0x9cb7b6 gimplify_stmt(tree_node**, gimple_statement_base**)
        ../../gcc/gcc/gimplify.c:5334
0x9ccf7a gimplify_body(tree_node*, bool)
        ../../gcc/gcc/gimplify.c:8531
0x9cd579 gimplify_function_tree(tree_node*)
        ../../gcc/gcc/gimplify.c:8684
Please submit a full bug report, [etc.]

Btw, clang 3.2 accepts the above code snippet.
Also the code is accepted if 'A' is replaced by 'int'.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-31 15:22 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-31  0:24 [Bug c++/59646] New: [4.7/4.8/4.9 Regression] ICE with volatile in initializer list reichelt at gcc dot gnu.org
2014-01-07 11:54 ` [Bug c++/59646] " rguenth at gcc dot gnu.org
2014-01-30 10:44 ` paolo.carlini at oracle dot com
2014-01-30 13:47 ` jason at gcc dot gnu.org
2014-01-31 11:24 ` rguenth at gcc dot gnu.org
2014-01-31 14:15 ` jason at gcc dot gnu.org
2014-01-31 15:20 ` jason at gcc dot gnu.org
2014-01-31 15:21 ` jason at gcc dot gnu.org
2014-01-31 15:22 ` jason at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).