public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60211] New: ICE with #pragma GCC ivdep and for-loop on global scope
@ 2014-02-15 12:11 reichelt at gcc dot gnu.org
  2014-12-29  9:32 ` [Bug c++/60211] [4.9/5 Regression] " paolo.carlini at oracle dot com
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-15 12:11 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60211
           Summary: ICE with #pragma GCC ivdep and for-loop on global
                    scope
           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 on trunk:

=================================
void foo()
{}
  int i;
#pragma GCC ivdep
  for (i = 0; i < 2; ++i)
    ;
}
=================================

bug.cc:6:5: internal compiler error: in add_stmt, at cp/semantics.c:391
     ;
     ^
0x7268a8 add_stmt(tree_node*)
        ../../gcc/gcc/cp/semantics.c:391
0x6d0457 cp_parser_iteration_statement
        ../../gcc/gcc/cp/parser.c:10516
0x6a7600 cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:31461
0x6d2c51 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10864
0x6d44ba cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d44ba c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f3823 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]


Declaring the variable within the for-loop produces a different stack trace:

=================================
void foo()
{}
#pragma GCC ivdep
  for (int i = 0; i < 2; ++i)
    ;
}
=================================

bug.cc:4:12: internal compiler error: tree check: expected tree that contains
'decl with visibility' structure, have 'parm_decl' in start_decl, at
cp/decl.c:4572
   for (int i = 0; i < 2; ++i)
            ^
0xdc0f24 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/gcc/tree.c:9364
0x5ee658 contains_struct_check
        ../../gcc/gcc/tree.h:2823
0x5ee658 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/gcc/cp/decl.c:4572
0x6c7efe cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16680
0x6c9989 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11205
0x6d02bd cp_parser_for_init_statement
        ../../gcc/gcc/cp/parser.c:10558
0x6d02bd cp_parser_for
        ../../gcc/gcc/cp/parser.c:10038
0x6d02bd cp_parser_iteration_statement
        ../../gcc/gcc/cp/parser.c:10505
0x6a7600 cp_parser_pragma
        ../../gcc/gcc/cp/parser.c:31461
0x6d2c51 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10864
0x6d44ba cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6d44ba c_parse_file()
        ../../gcc/gcc/cp/parser.c:31536
0x7f3823 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]


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

end of thread, other threads:[~2015-02-13 19:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-15 12:11 [Bug c++/60211] New: ICE with #pragma GCC ivdep and for-loop on global scope reichelt at gcc dot gnu.org
2014-12-29  9:32 ` [Bug c++/60211] [4.9/5 Regression] " paolo.carlini at oracle dot com
2015-01-09 11:29 ` rguenth at gcc dot gnu.org
2015-01-21 18:48 ` paolo.carlini at oracle dot com
2015-02-13 14:44 ` jason at gcc dot gnu.org
2015-02-13 17:57 ` paolo at gcc dot gnu.org
2015-02-13 17:59 ` [Bug c++/60211] [4.9 " paolo.carlini at oracle dot com
2015-02-13 19:13 ` 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).