https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97520
Bug ID: 97520 Summary: ICE in calc_stmt, at gimple-range.cc:399 with "-O1 -fno-tree-fre -ftree-vrp" Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: suochenyao at 163 dot com Target Milestone: --- ******************************************************************************* OS and Platform: CentOS Linux release 7.8.2003 (Core), x86_64 GNU/Linux ******************************************************************************* Program: char a; void b() { char *c[5]; char *d = &a; &d; *(c[4] = d); } int main() { return 0; } ******************************************************************************* gcc version: $ gcc -v Using built-in specs. COLLECT_GCC=/home/suocy/bin/gcc-dev/bin/gcc COLLECT_LTO_WRAPPER=/home/suocy/bin/gcc-dev/libexec/gcc/x86_64-pc-linux-gnu/11.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../configure --prefix=/home/suocy/bin/gcc-dev --disable-multilib --enable-languages=c,c++ Thread model: posix Supported LTO compression algorithms: zlib gcc version 11.0.0 20201020 (experimental) (GCC) ******************************************************************************* Command Lines: $ gcc -Wall -Wextra -fno-strict-aliasing -fwrapv -O1 -fno-tree-fre -ftree-vrp a.c a.c: In function ‘b’: a.c:5:3: warning: statement with no effect [-Wunused-value] 5 | &d; | ^~ a.c:6:3: warning: value computed is not used [-Wunused-value] 6 | *(c[4] = d); | ^~~~~~~~~~~ during GIMPLE pass: evrp a.c:8:1: internal compiler error: in calc_stmt, at gimple-range.cc:399 8 | int main() { return 0; } | ^~~ 0x7f6095 gimple_ranger::calc_stmt(irange&, gimple*, tree_node*) ../../gcc/gimple-range.cc:399 0x188dc5f gimple_ranger::range_of_stmt(irange&, gimple*, tree_node*) ../../gcc/gimple-range.cc:992 0x188a498 gimple_ranger::range_of_expr(irange&, tree_node*, gimple*) ../../gcc/gimple-range.cc:883 0x10a236d range_query::value_of_expr(tree_node*, gimple*) ../../gcc/value-query.cc:85 0x172bc71 hybrid_folder::value_of_expr(tree_node*, gimple*) ../../gcc/gimple-ssa-evrp.c:235 0xf5c73e substitute_and_fold_dom_walker::before_dom_children(basic_block_def*) ../../gcc/tree-ssa-propagate.c:1112 0x1703777 dom_walker::walk(basic_block_def*) ../../gcc/domwalk.c:309 0xf5b955 substitute_and_fold_engine::substitute_and_fold(basic_block_def*) ../../gcc/tree-ssa-propagate.c:1283 0x172b8e6 execute_early_vrp ../../gcc/gimple-ssa-evrp.c:349 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.