[BUG] ICE in get_narrower, at tree.c:8532

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi

Apologies for sending the bug report to the mailing list. I couldn't
create bugzilla account, or use the old login.

I have the following crash with yesterday's gcc version from trunk:


$ /opt/gcc-trunk/bin/g++ test-ice.cpp
test-ice.cpp: In member function ‘int C<T>::test()’:
test-ice.cpp:18:56: internal compiler error: tree check: expected tree
that contains ‘decl common’ structure, have ‘identifier_node’ in
get_narrower, at tree.c:8532
      return (((a.tv_sec == b.tv_sec) ? false : true) + flag); //
needs to use `flag'/operator
                                                        ^
0xe60934 tree_contains_struct_check_failed(tree_node const*,
tree_node_structure_enum, char const*, int, char const*)
        ../../gcc/tree.c:9349
0xe697dc contains_struct_check(tree_node*, tree_node_structure_enum,
char const*, int, char const*)
        ../../gcc/tree.h:2847
0xe697dc get_narrower(tree_node*, int*)
        ../../gcc/tree.c:8532
0x9ea36c operand_equal_for_comparison_p
        ../../gcc/fold-const.c:2846
0x9fd60a fold_ternary_loc(unsigned int, tree_code, tree_node*,
tree_node*, tree_node*, tree_node*)
        ../../gcc/fold-const.c:13904
0x9ffcb3 fold_build3_stat_loc(unsigned int, tree_code, tree_node*,
tree_node*, tree_node*, tree_node*)
        ../../gcc/fold-const.c:14861
0x9e0b66 fold_unary_loc(unsigned int, tree_code, tree_node*, tree_node*)
        ../../gcc/fold-const.c:7614
0x9e52b9 fold_build1_stat_loc(unsigned int, tree_code, tree_node*, tree_node*)
        ../../gcc/fold-const.c:14755
0x72fb5a ocp_convert(tree_node*, tree_node*, int, int, int)
        ../../gcc/cp/cvt.c:792
0x71d677 cp_default_conversion
        ../../gcc/cp/typeck.c:2050
0x72167f cp_build_binary_op(unsigned int, tree_code, tree_node*,
tree_node*, int)
        ../../gcc/cp/typeck.c:3959
0x5e9507 build_new_op_1
        ../../gcc/cp/call.c:5660
0x5ea0ce build_new_op(unsigned int, tree_code, int, tree_node*,
tree_node*, tree_node*, tree_node**, int)
        ../../gcc/cp/call.c:5705
0x710a6e build_x_binary_op(unsigned int, tree_code, tree_node*,
tree_code, tree_node*, tree_code, tree_node**, int)
        ../../gcc/cp/typeck.c:3779
0x6e9eab cp_parser_binary_expression
        ../../gcc/cp/parser.c:8152
0x6ea2db cp_parser_assignment_expression
        ../../gcc/cp/parser.c:8274
0x6ec974 cp_parser_expression
        ../../gcc/cp/parser.c:8436
0x6e487e cp_parser_primary_expression
        ../../gcc/cp/parser.c:4317
0x6e6327 cp_parser_postfix_expression
        ../../gcc/cp/parser.c:6010
0x6e90f9 cp_parser_unary_expression
        ../../gcc/cp/parser.c:7289
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.


$ cat test-gcc-crash.cpp
<cut>
struct timeval
{
  int tv_sec;
};

// needs to be a template class
template<typename T> struct C
{
   int test()
   {
     bool flag(false);
     struct timeval a, b;

     //return (flag || timercmp(&a, &b, <) ); // timercmp comes from
<sys/time.h>
     //return (flag &&  (((&a)->tv_sec == (&b)->tv_sec) ? false :
true) ); // simplified timercmp
     //return (flag && ((a.tv_sec == b.tv_sec) ? false : true) );
     return (((a.tv_sec == b.tv_sec) ? false : true) + flag); // needs
to use `flag'/operator
   }
};
</cut>

$ /opt/gcc-trunk/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/opt/gcc-trunk/bin/g++
COLLECT_LTO_WRAPPER=/opt/gcc-trunk/libexec/gcc/x86_64-unknown-linux-gnu/5.0.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ../configure --prefix=/opt/gcc-trunk
--enable-cloog-backend --enable-lto --enable-languages=c,c++
--enable-libstdcxx-time --enable-gold --enable-plugins
--disable-multilib : (reconfigured) ../configure
--prefix=/opt/gcc-trunk --enable-cloog-backend --enable-lto
--enable-languages=c,c++ --enable-libstdcxx-time --enable-gold
--enable-plugins --disable-multilib
Thread model: posix
gcc version 5.0.0 20140922 (experimental) (GCC)


Thanks
Marcin





[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux