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

--- Comment #2 from Zhendong Su <zhendong.su at inf dot ethz.ch> ---
It seems that the fix for PR 111303 did not fix this ICE.

[511] % gcctk -v
Using built-in specs.
COLLECT_GCC=gcctk
COLLECT_LTO_WRAPPER=/local/home/suz/suz-local/software/local/gcc-trunk/bin/../libexec/gcc/x86_64-pc-linux-gnu/14.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --disable-bootstrap
--enable-checking=yes --prefix=/local/suz-local/software/local/gcc-trunk
--enable-sanitizers --enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 14.0.0 20230919 (experimental) (GCC) 
[512] % 
[512] % gcctk -O1 small.c 
small.c: In function ‘main’:
small.c:3:23: warning: division by zero [-Wdiv-by-zero]
    3 |   return b ? 1 << --b / 0 : 0;
      |                       ^
during GIMPLE pass: ccp
small.c:4:1: internal compiler error: in lower_bound, at value-range.h:1078
    4 | }
      | ^
0x9293e1 irange::lower_bound(unsigned int) const
        ../../gcc-trunk/gcc/value-range.h:1078
0x9293e1 irange::lower_bound(unsigned int) const
        ../../gcc-trunk/gcc/value-range.h:1076
0x9293e1 gimple_simplify_TRUNC_DIV_EXPR(gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), code_helper, tree_node*, tree_node*, tree_node*)
        /local/suz-local/software/gccbuild/objdir/gcc/gimple-match-4.cc:8423
0x1646816 gimple_resimplify2
        ../../gcc-trunk/gcc/gimple-match-exports.cc:1001
0x16472b0 gimple_simplify(gimple*, gimple_match_op*, gimple**, tree_node*
(*)(tree_node*), tree_node* (*)(tree_node*))
        ../../gcc-trunk/gcc/gimple-match-exports.cc:868
0xca6c5c gimple_fold_stmt_to_constant_1(gimple*, tree_node* (*)(tree_node*),
tree_node* (*)(tree_node*))
        ../../gcc-trunk/gcc/gimple-fold.cc:7545
0x11316f2 ccp_fold
        ../../gcc-trunk/gcc/tree-ssa-ccp.cc:1288
0x11316f2 evaluate_stmt
        ../../gcc-trunk/gcc/tree-ssa-ccp.cc:2225
0x11330c5 visit_assignment
        ../../gcc-trunk/gcc/tree-ssa-ccp.cc:2859
0x11e705a ssa_propagation_engine::simulate_stmt(gimple*)
        ../../gcc-trunk/gcc/tree-ssa-propagate.cc:221
0x11e736a ssa_propagation_engine::simulate_block(basic_block_def*)
        ../../gcc-trunk/gcc/tree-ssa-propagate.cc:328
0x11e7773 ssa_propagation_engine::ssa_propagate()
        ../../gcc-trunk/gcc/tree-ssa-propagate.cc:478
0x1128f00 do_ssa_ccp
        ../../gcc-trunk/gcc/tree-ssa-ccp.cc:2978
0x1128f00 execute
        ../../gcc-trunk/gcc/tree-ssa-ccp.cc:3024
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
[513] % 
[513] % cat small.c 
int main() {
  unsigned b;
  return b ? 1 << --b / 0 : 0;
}

Reply via email to