public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61723] New: [C++11] ICE in contains_struct_check
@ 2014-07-05 18:58 ppluzhnikov at google dot com
  2014-07-15 14:09 ` [Bug c++/61723] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-07-05 18:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

            Bug ID: 61723
           Summary: [C++11] ICE in contains_struct_check
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppluzhnikov at google dot com

Google ref: b/16030670.

AFAICT, this is broken in all of 4.7 / 4.8 / 4.9 / 4.10.
Accepted by Clang without warnings.

gcc-svn-r212277/bin/g++ -c -std=c++11 t.cc
t.cc: In function ‘void fn1()’:
t.cc:29:14: internal compiler error: Segmentation fault
     spec.dim = { };
              ^
0xb8527f crash_signal
    ../../gcc/toplev.c:337
0x557b81 contains_struct_check(tree_node*, tree_node_structure_enum, char
const*, int, char const*)
    ../../gcc/tree.h:2844
0x557b81 convert_like_real
    ../../gcc/cp/call.c:6257
0x554eab build_over_call
    ../../gcc/cp/call.c:7162
0x55800b convert_like_real
    ../../gcc/cp/call.c:6160
0x55799b convert_like_real
    ../../gcc/cp/call.c:6290
0x554eab build_over_call
    ../../gcc/cp/call.c:7162
0x56785c build_new_op_1
    ../../gcc/cp/call.c:5513
0x567c4e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
    ../../gcc/cp/call.c:5674
0x6a6aeb cp_build_modify_expr(tree_node*, tree_code, tree_node*, int)
    ../../gcc/cp/typeck.c:7399
0x669632 cp_parser_assignment_expression
    ../../gcc/cp/parser.c:8216
0x66b8a3 cp_parser_expression
    ../../gcc/cp/parser.c:8342
0x66c0cc cp_parser_expression
    ../../gcc/cp/parser.c:8381
0x66c0cc cp_parser_expression_statement
    ../../gcc/cp/parser.c:9720
0x660e98 cp_parser_statement
    ../../gcc/cp/parser.c:9571
0x661ca9 cp_parser_statement_seq_opt
    ../../gcc/cp/parser.c:9843
0x661e16 cp_parser_compound_statement
    ../../gcc/cp/parser.c:9797
0x67319b cp_parser_function_body
    ../../gcc/cp/parser.c:18872
0x67319b cp_parser_ctor_initializer_opt_and_function_body
    ../../gcc/cp/parser.c:18908
0x679883 cp_parser_function_definition_after_declarator
    ../../gcc/cp/parser.c:23044
Please submit a full bug report,
with preprocessed source if appropriate.


gcc-svn-r212277/bin/g++ -c -std=c++11 t.cc -DBUG1
t.cc: In function ‘void fn1()’:
t.cc:26:1: error: non-trivial conversion at assignment
 fn1 ()
 ^
int
const int[0:18446744073709551615] *
D.2173._M_len = &._0;
t.cc:26:1: internal compiler error: verify_gimple failed
0xbb49ff verify_gimple_in_seq(gimple_statement_base*)
    ../../gcc/tree-cfg.c:4665
0x9cb6c1 gimplify_body(tree_node*, bool)
    ../../gcc/gimplify.c:8848
0x9cba26 gimplify_function_tree(tree_node*)
    ../../gcc/gimplify.c:8933
0x84be17 analyze_function
    ../../gcc/cgraphunit.c:650
0x84d01f analyze_functions
    ../../gcc/cgraphunit.c:1028
0x84e8e5 finalize_compilation_unit()
    ../../gcc/cgraphunit.c:2331
0x63b07e cp_write_global_declarations()
    ../../gcc/cp/decl2.c:4652
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.


// -- cut ---
namespace std {
  template < class > struct initializer_list
  {
#if BUG1
    int _M_len;
#endif
    const int *begin ();
    const int *end ();
  };
}

struct J
{
    J (const int &);
    template < typename InputIterator > J (InputIterator, InputIterator);
    J (std::initializer_list < int >p1):J (p1.begin (), p1.end ()) { }
};

struct L
{
    L ():dim (0) { }
    J dim;
};

void
fn1 ()
{
    L spec;
    spec.dim = { };
}
// --- cut ---
>From gcc-bugs-return-455704-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jul 05 19:33:38 2014
Return-Path: <gcc-bugs-return-455704-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 16705 invoked by alias); 5 Jul 2014 19:33:36 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 16620 invoked by uid 55); 5 Jul 2014 19:33:28 -0000
From: "tsaunders at mozilla dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug bootstrap/61679] build fails with G++ 4.5.1 - prototype for hash_table does not match any in class
Date: Sat, 05 Jul 2014 19:33:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: bootstrap
X-Bugzilla-Version: 4.10.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: tsaunders at mozilla dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61679-4-J7Xf6YUB4Q@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61679-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61679-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg00295.txt.bz2
Content-length: 1230

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida679

--- Comment #1 from Trevor Saunders <tsaunders at mozilla dot com> ---
The following patch compiles with 4.9 for me, but I don't have easy
access to a machine with 4.5 on it, would you mind testing if it works
for you?

diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 22af12f..2356f8d 100644
--- a/gcc/hash-table.h
+++ b/gcc/hash-table.h
@@ -663,7 +663,7 @@ hash_table<Descriptor, Allocator, false>::~hash_table ()
    HASH is the hash value for the element to be inserted.  */

 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type **
+typename hash_table<Descriptor, Allocator, false>::value_type **
 hash_table<Descriptor, Allocator, false>
 ::find_empty_slot_for_expand (hashval_t hash)
 {
@@ -803,7 +803,7 @@ hash_table<Descriptor, Allocator, false>::clear_slot
(value_type **slot)
    be used to insert or delete an element. */

 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type *
+typename hash_table<Descriptor, Allocator, false>::value_type *
 hash_table<Descriptor, Allocator, false>
 ::find_with_hash (const compare_type *comparable, hashval_t hash)
 {


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
@ 2014-07-15 14:09 ` paolo.carlini at oracle dot com
  2014-07-15 15:22 ` jason at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-15 14:09 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

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> ---
I find this testcase rather weird: std::initializer_list isn't a random user
type: we have non-trivial "magic" in the front-end which *assumes* the actual
definition in our <initializer_list> header. You can see this in the testcase
here too, because the ICEs disappear if _M_len is declared as an (unsigned)
__SIZE_TYPE__ (not as an int) and an additional field _M_array is added too
(see our actual std::initializer_list for details). If you ask me, the Bug
Report seems invalid to me or at least very low priority, unless a version of
it not redefining std::initializer_list exists.


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
  2014-07-15 14:09 ` [Bug c++/61723] " paolo.carlini at oracle dot com
@ 2014-07-15 15:22 ` jason at gcc dot gnu.org
  2014-07-15 19:17 ` jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-15 15:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

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

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

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Agreed.


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
  2014-07-15 14:09 ` [Bug c++/61723] " paolo.carlini at oracle dot com
  2014-07-15 15:22 ` jason at gcc dot gnu.org
@ 2014-07-15 19:17 ` jason at gcc dot gnu.org
  2014-07-15 19:37 ` jason at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-15 19:17 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Tue Jul 15 19:16:29 2014
New Revision: 212574

URL: https://gcc.gnu.org/viewcvs?rev=212574&root=gcc&view=rev
Log:
    PR c++/60848
    PR c++/61723
    * call.c (is_std_init_list): Don't check CLASSTYPE_TEMPLATE_INFO.
    * class.c (finish_struct): Reject invalid definition of
    std::initializer_list.

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


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
                   ` (2 preceding siblings ...)
  2014-07-15 19:17 ` jason at gcc dot gnu.org
@ 2014-07-15 19:37 ` jason at gcc dot gnu.org
  2014-07-15 20:51 ` ppluzhnikov at google dot com
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: jason at gcc dot gnu.org @ 2014-07-15 19:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
   Target Milestone|---                         |4.10.0

--- Comment #4 from Jason Merrill <jason at gcc dot gnu.org> ---
OK, now GCC will reject the definition of std::initializer_list rather than
ICE.


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
                   ` (3 preceding siblings ...)
  2014-07-15 19:37 ` jason at gcc dot gnu.org
@ 2014-07-15 20:51 ` ppluzhnikov at google dot com
  2014-07-31 13:34 ` paolo.carlini at oracle dot com
  2014-12-12 18:53 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: ppluzhnikov at google dot com @ 2014-07-15 20:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

--- Comment #6 from Paul Pluzhnikov <ppluzhnikov at google dot com> ---
It turns out that the original unreduced test case does not error on trunk
@r212277;
it only ICEs on gcc-4.8 and gcc-4.9 branches.

But once I creduced it using 4.9, the reduced test also ICEd on trunk.

I have just verified that the latest 4.9 @r212536 crashes like so on
non-reduced test:

gcc-svn-4_9-r212536/bin/g++ -c -std=c++11 t.ii  -O2
t.cc: In function ‘ZZZZ’:
t.cc:22:24: internal compiler error: Segmentation fault
0xb947ff crash_signal
    ../../gcc/toplev.c:337
0x952096 fold_comparison
    ../../gcc/fold-const.c:9074
0x95be35 fold_binary_loc(unsigned int, tree_code, tree_node*, tree_node*,
tree_node*)
    ../../gcc/fold-const.c:13563
0xbca30d cleanup_control_expr_graph
    ../../gcc/tree-cfgcleanup.c:112
0xbca30d cleanup_control_flow_bb
    ../../gcc/tree-cfgcleanup.c:187
0xbca30d cleanup_tree_cfg_bb
    ../../gcc/tree-cfgcleanup.c:630
0xbcbd48 cleanup_tree_cfg_1
    ../../gcc/tree-cfgcleanup.c:675
0xbcbd48 cleanup_tree_cfg_noloop
    ../../gcc/tree-cfgcleanup.c:731
0xbcbd48 cleanup_tree_cfg()
    ../../gcc/tree-cfgcleanup.c:786
0xaea194 execute_function_todo
    ../../gcc/passes.c:1811
0xaeaa83 execute_todo
    ../../gcc/passes.c:1887
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.


This appears to be a different ICE.
Should I reduce it?
>From gcc-bugs-return-456435-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue Jul 15 21:08:11 2014
Return-Path: <gcc-bugs-return-456435-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 11571 invoked by alias); 15 Jul 2014 21:08:10 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 11433 invoked by uid 48); 15 Jul 2014 21:08:04 -0000
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/61723] [C++11] ICE in contains_struct_check
Date: Tue, 15 Jul 2014 21:08:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: ice-on-invalid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jason at gcc dot gnu.org
X-Bugzilla-Status: RESOLVED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: jason at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.10.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields:
Message-ID: <bug-61723-4-4u5sHZ5Sfy@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-61723-4@http.gcc.gnu.org/bugzilla/>
References: <bug-61723-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-07/txt/msg01026.txt.bz2
Content-length: 260

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida723

--- Comment #7 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Paul Pluzhnikov from comment #6)
> This appears to be a different ICE.
> Should I reduce it?

Please.  And open a new PR for it.


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
                   ` (4 preceding siblings ...)
  2014-07-15 20:51 ` ppluzhnikov at google dot com
@ 2014-07-31 13:34 ` paolo.carlini at oracle dot com
  2014-12-12 18:53 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-07-31 13:34 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hjl.tools at gmail dot com

--- Comment #9 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 59318 has been marked as a duplicate of this bug. ***


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

* [Bug c++/61723] [C++11] ICE in contains_struct_check
  2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
                   ` (5 preceding siblings ...)
  2014-07-31 13:34 ` paolo.carlini at oracle dot com
@ 2014-12-12 18:53 ` paolo.carlini at oracle dot com
  6 siblings, 0 replies; 8+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-12-12 18:53 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61723

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vanyacpp at gmail dot com

--- Comment #10 from Paolo Carlini <paolo.carlini at oracle dot com> ---
*** Bug 60683 has been marked as a duplicate of this bug. ***


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

end of thread, other threads:[~2014-12-12 18:53 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-05 18:58 [Bug c++/61723] New: [C++11] ICE in contains_struct_check ppluzhnikov at google dot com
2014-07-15 14:09 ` [Bug c++/61723] " paolo.carlini at oracle dot com
2014-07-15 15:22 ` jason at gcc dot gnu.org
2014-07-15 19:17 ` jason at gcc dot gnu.org
2014-07-15 19:37 ` jason at gcc dot gnu.org
2014-07-15 20:51 ` ppluzhnikov at google dot com
2014-07-31 13:34 ` paolo.carlini at oracle dot com
2014-12-12 18:53 ` paolo.carlini at oracle dot com

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