[Bug ipa/103486] New: ICE on valid code at -Os and above on x86_64-linux-gnu: Segmentation fault

zhendong.su at inf dot ethz.ch gcc-bugzilla@gcc.gnu.org
Tue Nov 30 08:01:39 GMT 2021


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

            Bug ID: 103486
           Summary: ICE on valid code at -Os and above on
                    x86_64-linux-gnu: Segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: ipa
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhendong.su at inf dot ethz.ch
                CC: marxin at gcc dot gnu.org
  Target Milestone: ---

It seems to be a recent regression.

[536] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/suz-local/software/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/12.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--prefix=/local/suz-local/software/local/gcc-trunk --enable-languages=c,c++
--disable-werror --enable-multilib --with-system-zlib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 12.0.0 20211130 (experimental) [master r12-5591-g2acbc4eba33] (GCC)
[537] %
[537] % gcctk -O1 small.c; ./a.out
[538] %
[538] % gcctk -Os small.c
during IPA pass: inline
small.c:10:1: internal compiler error: Segmentation fault
   10 | }
      | ^
0xe9256f crash_signal
        ../../gcc-trunk/gcc/toplev.c:322
0x1c9e436 operator_div::wi_fold(irange&, tree_node*,
generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage>
const&, generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&) const
        ../../gcc-trunk/gcc/range-op.cc:1836
0x1c9ac4f range_operator::wi_fold_in_parts(irange&, tree_node*,
generic_wide_int<wide_int_storage> const&, generic_wide_int<wide_int_storage>
const&, generic_wide_int<wide_int_storage> const&,
generic_wide_int<wide_int_storage> const&) const
        ../../gcc-trunk/gcc/range-op.cc:192
0x1c9b4af range_operator::fold_range(irange&, tree_node*, irange const&, irange
const&, tree_code) const
        ../../gcc-trunk/gcc/range-op.cc:214
0x11b2a54 range_fold_binary_expr(int_range<1u>*, tree_code, tree_node*,
int_range<1u> const*, int_range<1u> const*)
        ../../gcc-trunk/gcc/tree-vrp.c:1080
0xbcc942 evaluate_conditions_for_known_args
        ../../gcc-trunk/gcc/ipa-fnsummary.c:511
0xbd1fae evaluate_properties_for_edge(cgraph_edge*, bool, unsigned int*,
unsigned int*, ipa_auto_call_arg_values*, bool)
        ../../gcc-trunk/gcc/ipa-fnsummary.c:726
0xbe83ed do_estimate_edge_size(cgraph_edge*)
        ../../gcc-trunk/gcc/ipa-inline-analysis.c:330
0xbeaa0f estimate_edge_size
        ../../gcc-trunk/gcc/ipa-inline.h:79
0xbeaa0f estimate_edge_growth
        ../../gcc-trunk/gcc/ipa-inline.h:100
0xbeaa0f do_estimate_growth_1
        ../../gcc-trunk/gcc/ipa-inline-analysis.c:429
0xbeaf55 cgraph_node::call_for_symbol_and_aliases(bool (*)(cgraph_node*,
void*), void*, bool)
        ../../gcc-trunk/gcc/cgraph.h:3411
0xbeaf55 estimate_growth(cgraph_node*)
        ../../gcc-trunk/gcc/ipa-inline-analysis.c:467
0x1c09543 inline_small_functions
        ../../gcc-trunk/gcc/ipa-inline.c:1980
0x1c09543 ipa_inline
        ../../gcc-trunk/gcc/ipa-inline.c:2743
0x1c09543 execute
        ../../gcc-trunk/gcc/ipa-inline.c:3142
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[539] %
[539] % cat small.c
int a, b;
void c(long d) {
  while (1)
    a = a && (1 / d);
}
int main() {
  if (a)
    c(b);
  return 0;
}


More information about the Gcc-bugs mailing list