https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81874
Bug ID: 81874 Summary: [6.3/6.4][mips]internal compiler error: in do_SUBST, at combine.c:725 Product: gcc Version: tree-ssa Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: zwzhangwen.zhang at huawei dot com Target Milestone: --- mips-sde-elf-gcc -O2 -w test.i -S test.i: In function 'func_1': test.i:2438:1: internal compiler error: in do_SUBST, at combine.c:725 } ^ 0xd7424d do_SUBST gcc-6.3.0/gcc/combine.c:725 0xd8328e subst gcc-6.3.0/gcc/combine.c:5435 0xd84fa1 try_combine gcc-6.3.0/gcc/combine.c:3274 0xd8aefd combine_instructions gcc-6.3.0/gcc/combine.c:1475 0xd8aefd rest_of_handle_combine gcc-6.3.0/gcc/combine.c:14370 0xd8aefd execute gcc-6.3.0/gcc/combine.c:14413 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. gcc version 6.3.0 /6.4.0 I have checked gcc-7.1.0 and that's ok because of commit NO. ad010d47fc7bf4d598eb113c286c265b266094be https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=ad010d47fc7bf4d598eb113c286c265b266094be It do deleting redundant expr, but if using -fno-code_hoisting, ICE can be found. I doubt that cse1 pass has some problem and record reg 196 equal to const -2147483648 in EQ jump_insn. testcase is as follows: static long int (safe_add_func_int32_t_s_s)(long int si1, long int si2 ) { return (((si1>0) && (si2>0) && (si1 > (0x7fffffffL -si2))) || ((si1<0) && (si2<0) && (si1 < ((-0x7fffffffL - 1)-si2)))) ?((si1)) :(si1 + si2); } static short unsigned int (safe_mod_func_uint16_t_u_u)(short unsigned int ui1, short unsigned int ui2 ) { return (ui2 == 0) ? ((ui1)) : (ui1 % ui2); } g_71; *g_723; long long int func_34 (long unsigned int, long unsigned int, unsigned char, long int *, short unsigned int); func_1 () { func_34 (0, 0, safe_add_func_int32_t_s_s (1 && g_71, *g_723), 0, 0); } long long int func_34 (long unsigned int p_35, long unsigned int p_36, unsigned char p_37, long int * p_38, short unsigned int p_39) { *p_38 = safe_mod_func_uint16_t_u_u (++*g_723, p_37); }