https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77677
Bug ID: 77677 Summary: ICE at -O1 and above in both 32-bit and 64-bit modes on x86_64-linux-gnu (internal compiler error: in set_value_range, at tree-vrp.c:361) Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: chengniansun at gmail dot com Target Milestone: --- If I add "int" in front of "p1", then the crash disappears. $ gcc-trunk -v Using built-in specs. COLLECT_GCC=gcc-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.0 20160921 (experimental) [trunk revision 240316] (GCC) $ $ gcc-trunk -O3 small.c small.c: In function ‘fn1’: small.c:2:5: warning: type of ‘p1’ defaults to ‘int’ [-Wimplicit-int] int fn1(p1) { return p1 == 0 || a % p1; } ^~~ small.c: At top level: small.c:7:1: internal compiler error: in set_value_range, at tree-vrp.c:361 } ^ 0xe61ec8 set_value_range ../../gcc-source-trunk/gcc/tree-vrp.c:360 0xe6542e vrp_meet_1 ../../gcc-source-trunk/gcc/tree-vrp.c:8639 0xe6542e vrp_meet(value_range*, value_range const*) ../../gcc-source-trunk/gcc/tree-vrp.c:8716 0x12e9ef5 ipcp_vr_lattice::meet_with_1(value_range const*) ../../gcc-source-trunk/gcc/ipa-cp.c:987 0x12f038c ipcp_vr_lattice::meet_with(value_range const*) ../../gcc-source-trunk/gcc/ipa-cp.c:969 0x12f038c propagate_vr_accross_jump_function ../../gcc-source-trunk/gcc/ipa-cp.c:2077 0x12f038c propagate_constants_accross_call ../../gcc-source-trunk/gcc/ipa-cp.c:2435 0x12f2918 propagate_constants_topo ../../gcc-source-trunk/gcc/ipa-cp.c:3329 0x12f2918 ipcp_propagate_stage ../../gcc-source-trunk/gcc/ipa-cp.c:3439 0x12f4b63 ipcp_driver ../../gcc-source-trunk/gcc/ipa-cp.c:5246 0x12f4b63 execute ../../gcc-source-trunk/gcc/ipa-cp.c:5342 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 small.c int a, b; int fn1(p1) { return p1 == 0 || a % p1; } int main() { b = fn1(2592930443); return 0; } $