https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78599
Bug ID: 78599 Summary: [7 Regression] hwint.h:292:72: runtime error: shift exponent 64 is too large for 64-bit type 'long int' Product: gcc Version: 7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: ipa Assignee: unassigned at gcc dot gnu.org Reporter: trippels at gcc dot gnu.org CC: mjambor at suse dot cz, prathamesh3492 at gcc dot gnu.org Target Milestone: --- Since r239769: commit a54071b275d13d8516e0cb305fb5cb49da201f14 Author: prathamesh3492 <prathamesh3492@138bc75d-0d04-0410-961f-82ee72b054a4> Date: Fri Aug 26 08:05:39 2016 +0000 Patch for performing interprocedural bitwise constant propagation. 2016-08-26 Prathamesh Kulkarni <prathamesh.kulka...@linaro.org> Martin Jambhor <mjam...@suse.cz> I get: ~ % UBSAN_OPTIONS=print_stacktrace=1 /var/tmp/gcc_ubsan/usr/local/bin/g++ -O2 -flto bench.cpp ... ../../gcc/gcc/hwint.h:292:61: runtime error: shift exponent 64 is too large for 64-bit type 'long unsigned int' #0 0x34f7541 in sext_hwi ../../gcc/gcc/hwint.h:292 #1 0x34f7541 in wi::unary_traits<generic_wide_int<fixed_wide_int_storage<192> > >::result_type wi::sext<generic_wide_int<fixed_wide_int_storage<192> > >(generic_wide_int<fixed_wide_int_storage<192> > const&, unsigned int) ../../gcc/gcc/wide-int.h:2063 #2 0x34f7541 in ipcp_bits_lattice::meet_with(generic_wide_int<fixed_wide_int_storage<192> >, generic_wide_int<fixed_wide_int_storage<192> >, unsigned int) ../../gcc/gcc/ipa-cp.c:1024 #3 0x34fe417 in propagate_bits_accross_jump_function(cgraph_edge*, int, ipa_jump_func*, ipcp_bits_lattice*) ../../gcc/gcc/ipa-cp.c:1836 #4 0x350009c in propagate_constants_accross_call ../../gcc/gcc/ipa-cp.c:2261 #5 0x3510372 in propagate_constants_topo ../../gcc/gcc/ipa-cp.c:3162 #6 0x3510372 in ipcp_propagate_stage ../../gcc/gcc/ipa-cp.c:3272 #7 0x351b158 in ipcp_driver ../../gcc/gcc/ipa-cp.c:5002 #8 0x16282e8 in execute_one_pass(opt_pass*) ../../gcc/gcc/passes.c:2370 #9 0x162c0ca in execute_ipa_pass_list(opt_pass*) ../../gcc/gcc/passes.c:2805 #10 0x698e32 in do_whole_program_analysis ../../gcc/gcc/lto/lto.c:3095 #11 0x698e32 in lto_main() ../../gcc/gcc/lto/lto.c:3316 #12 0x1a05a7a in compile_file ../../gcc/gcc/toplev.c:463 #13 0x619d44 in do_compile ../../gcc/gcc/toplev.c:1983 #14 0x619d44 in toplev::main(int, char**) ../../gcc/gcc/toplev.c:2117 #15 0x61c3a6 in main ../../gcc/gcc/main.c:39 #16 0x7fc03c93b310 in __libc_start_main ../csu/libc-start.c:286 #17 0x61c7c9 in _start (/var/tmp/gcc_ubsan/usr/local/libexec/gcc/x86_64-pc-linux-gnu/7.0.0/lto1+0x61c7c9) Happens with almost any program when using -flto.