Bug 108668 - [13 Regression] ICE in decompose, at wide-int.h:984
Summary: [13 Regression] ICE in decompose, at wide-int.h:984
Status: RESOLVED DUPLICATE of bug 108639
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 13.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks: yarpgen
  Show dependency treegraph
 
Reported: 2023-02-03 22:46 UTC by Vsevolod Livinskii
Modified: 2023-02-03 22:56 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vsevolod Livinskii 2023-02-03 22:46:19 UTC
Link to the Compiler Explorer: https://godbolt.org/z/oY1x13Kc8
There is an open (Bug 102760) and recently closed (Bug 108547) issues with the same assert message, but differences in reproducers, versions, and stack trace make me suspicious that this might be a different bug.

Reproducer:

bool a;
const unsigned long long &foo(const unsigned long long &p1,
                            const unsigned long long &c) {
  return c > p1 ? p1 : c;
}
char e;
unsigned long long *f;
long g;
void h() {
  for (int d = 0; d < e; d = foo(8, f[0]) << foo(5, f[0]))
    a = foo(1, foo(g, 7));
}

Error:
>$ g++ -O3 -c func.cpp
during GIMPLE pass: dom
func.cpp: In function 'void h()':
func.cpp:9:6: internal compiler error: in decompose, at wide-int.h:984
    9 | void h() {
      |      ^
0x8f652a wi::int_traits<generic_wide_int<wide_int_ref_storage<false, false> > >::decompose(long*, unsigned int, generic_wide_int<wide_int_ref_storage<false, false> > const&)
	/testing/gcc/gcc_src_master/gcc/wide-int.h:984
0x8f72d6 wi::int_traits<generic_wide_int<wide_int_storage> >::decompose(long*, unsigned int, generic_wide_int<wide_int_storage> const&)
	/testing/gcc/gcc_src_master/gcc/value-range.h:940
0x8f72d6 wide_int_ref_storage<true, false>::wide_int_ref_storage<generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&, unsigned int)
	/testing/gcc/gcc_src_master/gcc/wide-int.h:1034
0x8f72d6 generic_wide_int<wide_int_ref_storage<true, false> >::generic_wide_int<generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&, unsigned int)
	/testing/gcc/gcc_src_master/gcc/wide-int.h:790
0x8f72d6 bool wi::eq_p<generic_wide_int<wide_int_storage>, generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&)
	/testing/gcc/gcc_src_master/gcc/wide-int.h:1873
0x8f72d6 wi::binary_traits<generic_wide_int<wide_int_storage>, generic_wide_int<wide_int_storage>, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type, wi::int_traits<generic_wide_int<wide_int_storage> >::precision_type>::predicate_result operator==<generic_wide_int<wide_int_storage>, generic_wide_int<wide_int_storage> >(generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage> const&)
	/testing/gcc/gcc_src_master/gcc/wide-int.h:3307
0x8f72d6 irange::operator==(irange const&) const
	/testing/gcc/gcc_src_master/gcc/value-range.cc:1297
0x8f72d6 irange::operator==(irange const&) const
	/testing/gcc/gcc_src_master/gcc/value-range.cc:1266
0x21de1d6 range_operator::fold_range(irange&, tree_node*, irange const&, irange const&, relation_trio) const
	/testing/gcc/gcc_src_master/gcc/range-op.cc:271
0x21de8cc operator_lshift::fold_range(irange&, tree_node*, irange const&, irange const&, relation_trio) const
	/testing/gcc/gcc_src_master/gcc/range-op.cc:2246
0x20c90c0 fold_using_range::range_of_range_op(vrange&, gimple_range_op_handler&, fur_source&)
	/testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:589
0x20caaaa fold_using_range::fold_stmt(vrange&, gimple*, fur_source&, tree_node*)
	/testing/gcc/gcc_src_master/gcc/gimple-range-fold.cc:489
0x20bbefc gimple_ranger::fold_range_internal(vrange&, gimple*, tree_node*)
	/testing/gcc/gcc_src_master/gcc/gimple-range.cc:257
0x20bbefc gimple_ranger::range_of_stmt(vrange&, gimple*, tree_node*)
	/testing/gcc/gcc_src_master/gcc/gimple-range.cc:318
0x20bdcd0 gimple_ranger::range_of_expr(vrange&, tree_node*, gimple*)
	/testing/gcc/gcc_src_master/gcc/gimple-range.cc:126
0x13914bf cprop_operand
	/testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:1972
0x1393371 cprop_into_stmt
	/testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:2049
0x1393371 dom_opt_dom_walker::optimize_stmt(basic_block_def*, gimple_stmt_iterator*, bool*)
	/testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:2277
0x1394723 dom_opt_dom_walker::before_dom_children(basic_block_def*)
	/testing/gcc/gcc_src_master/gcc/tree-ssa-dom.cc:1682
0x2087717 dom_walker::walk(basic_block_def*)
	/testing/gcc/gcc_src_master/gcc/domwalk.cc:311

gcc version 13.0.1 20230203 (093e2e1b201c0f324e0d8bfe6487aa2d470a13e7)
Comment 1 Andrew Pinski 2023-02-03 22:56:40 UTC
Dup of bug 108639.

*** This bug has been marked as a duplicate of bug 108639 ***