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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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 ` rguenth at gcc dot gnu.org
  2014-01-30 10:44 ` paolo.carlini at oracle dot com
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-07 11:54 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.7.4


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-01-30 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Have to figure out if it's valid. ICC also accepts it.


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-30 13:47 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|ice-on-invalid-code         |ice-on-valid-code

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
I think it's well-formed; the initialization of the underlying array of the
initializer_list should be direct-, not copy-initialization.


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (2 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2014-01-31 11:24 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|error-recovery              |rejects-valid
           Priority|P3                          |P2


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (3 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-31 14:15 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-31
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
     Ever confirmed|0                           |1


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (4 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-31 15:20 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jan 31 15:20:12 2014
New Revision: 207346

URL: http://gcc.gnu.org/viewcvs?rev=207346&root=gcc&view=rev
Log:
    PR c++/59646
    * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
    [ck_list]: Check for error_mark_node.
    (build_aggr_conv): Set LOOKUP_NO_NARROWING and check_narrowing.

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


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (5 preceding siblings ...)
  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
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-31 15:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Jan 31 15:21:20 2014
New Revision: 207348

URL: http://gcc.gnu.org/viewcvs?rev=207348&root=gcc&view=rev
Log:
    PR c++/59646
    * call.c (convert_like_real) [ck_aggr]: Set TARGET_EXPR_LIST_INIT_P.
    [ck_list]: Check for error_mark_node.

Added:
    branches/gcc-4_8-branch/gcc/testsuite/g++.dg/cpp0x/initlist79.C
Modified:
    branches/gcc-4_8-branch/gcc/cp/ChangeLog
    branches/gcc-4_8-branch/gcc/cp/call.c


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

* [Bug c++/59646] [4.7/4.8/4.9 Regression] ICE with volatile in initializer list
  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
                   ` (6 preceding siblings ...)
  2014-01-31 15:21 ` jason at gcc dot gnu.org
@ 2014-01-31 15:22 ` jason at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jason at gcc dot gnu.org @ 2014-01-31 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.7.4                       |4.8.3

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
Fixed for 4.8.3/4.9.  Not applying to 4.7 unless someone cares.


^ 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).