https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79242
Bug ID: 79242 Summary: ICE in simplify_subreg, at simplify-rtx.c:6029 Product: gcc Version: 7.0.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: middle-end Assignee: unassigned at gcc dot gnu.org Reporter: jozef.l at somniumtech dot com Target Milestone: --- Created attachment 40588 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40588&action=edit Preprocessed source to reproduce ICE The attached preprocessed source (tester.ii) causes an ICE when built using the current GCC trunk (r244903). This was discovered trying to build the GCC trunk for the msp430 target with C and C++ support. The attached source is a reduced test case from libstdc++-v3/libsupc++/vec.cc which fails to build because of the same ICE. Target: msp430-elf Configured with: ../configure --target=msp430-elf --enable-languages=c,c++ gcc version 7.0.1 20170125 (experimental) (GCC) > msp430-elf-gcc -O0 tester.C tester.C: In function 'std::size_t __cxxabiv1::{anonymous}::compute_size(std::size_t, std::size_t)': tester.C:22:41: internal compiler error: in simplify_subreg, at simplify-rtx.c:6029 if (element_size && element_count > std::size_t(-1) / element_size) ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 0xcbfbd4 simplify_subreg(machine_mode, rtx_def*, machine_mode, unsigned int) ../../gcc/simplify-rtx.c:6029 0xcbff38 simplify_gen_subreg(machine_mode, rtx_def*, machine_mode, unsigned int) ../../gcc/simplify-rtx.c:6260 0xca7384 gen_lowpart_general(machine_mode, rtx_def*) ../../gcc/rtlhooks.c:47 0x9e256f convert_move(rtx_def*, rtx_def*, int) ../../gcc/expr.c:530 0x9e2c39 convert_modes(machine_mode, machine_mode, rtx_def*, int) ../../gcc/expr.c:685 0xaf6443 expand_arith_overflow_result_store ../../gcc/internal-fn.c:606 0xafb06f expand_mul_overflow ../../gcc/internal-fn.c:1887 0xafe1c8 expand_arith_overflow ../../gcc/internal-fn.c:2179 0x8d2e27 expand_call_stmt ../../gcc/cfgexpand.c:2569 0x8d2e27 expand_gimple_stmt_1 ../../gcc/cfgexpand.c:3571 0x8d2e27 expand_gimple_stmt ../../gcc/cfgexpand.c:3737 0x8d47a1 expand_gimple_basic_block ../../gcc/cfgexpand.c:5744 0x8d9d66 execute ../../gcc/cfgexpand.c:6357