https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71724

            Bug ID: 71724
           Summary: [5/6/7 Regression] ICE: Segmentation fault, deep
                    recursion between combine_simplify_rtx and subst
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: rtl-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: asolokha at gmx dot com
  Target Milestone: ---
            Target: powerpc-e500v2-linux-gnuspe

gcc 5, 6, 7 for 32-bit target all fail to compile the following testcase w/
-O1:

long long int ro, t9;

void
cg (void)
{
  ro = (t9 != 1);
  ro += (t9 != 0) ? t9 : ro;
}

% powerpc-e500v2-linux-gnuspe-gcc-5.4.0 -c -O1 fxgjkta3.c
powerpc-e500v2-linux-gnuspe-gcc-5.4.0: internal compiler error: Segmentation
fault (program cc1)

% powerpc-e500v2-linux-gnuspe-gcc-7.0.0-alpha20160626 -c -O1 fxgjkta3.c
powerpc-e500v2-linux-gnuspe-gcc-7.0.0-alpha20160626: internal compiler error:
Segmentation fault (program cc1)

Backtrace for gcc 7:

#0  0x0000000000eb99a6 in simplify_binary_operation_1(rtx_code, machine_mode,
rtx_def*, rtx_def*, rtx_def*, rtx_def*) ()
#1  0x0000000000eaf44d in simplify_binary_operation(rtx_code, machine_mode,
rtx_def*, rtx_def*) ()
#2  0x0000000001779ba1 in combine_simplify_rtx(rtx_def*, machine_mode, int,
int) ()
#3  0x000000000177443c in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#4  0x000000000177413d in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#5  0x000000000177413d in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#6  0x0000000001779eaa in combine_simplify_rtx(rtx_def*, machine_mode, int,
int) ()
#7  0x000000000177443c in subst(rtx_def*, rtx_def*, rtx_def*, int, int, int) ()
#8  0x0000000001779ee5 in combine_simplify_rtx(rtx_def*, machine_mode, int,
int) ()
<…>
#171156 0x0000000001779ee5 in combine_simplify_rtx(rtx_def*, machine_mode, int,
int) ()
#171157 0x000000000177443c in subst(rtx_def*, rtx_def*, rtx_def*, int, int,
int) ()
#171158 0x000000000177413d in subst(rtx_def*, rtx_def*, rtx_def*, int, int,
int) ()
#171159 0x0000000001772bfb in subst(rtx_def*, rtx_def*, rtx_def*, int, int,
int) ()
#171160 0x0000000001767ada in try_combine(rtx_insn*, rtx_insn*, rtx_insn*,
rtx_insn*, int*, rtx_insn*) ()
#171161 0x0000000001762fea in combine_instructions(rtx_insn*, unsigned int) ()
#171162 0x00000000017625b9 in rest_of_handle_combine() ()
#171163 0x0000000001762565 in (anonymous
namespace)::pass_combine::execute(function*) ()
#171164 0x0000000000dbbbd6 in execute_one_pass(opt_pass*) ()
#171165 0x0000000000dbc74b in execute_pass_list_1(opt_pass*) ()
#171166 0x0000000000dbc774 in execute_pass_list_1(opt_pass*) ()
#171167 0x0000000000dac811 in execute_pass_list(function*, opt_pass*) ()
#171168 0x0000000000904e8f in cgraph_node::expand() ()
#171169 0x0000000000909bf8 in expand_all_functions() ()
#171170 0x0000000000908bff in symbol_table::compile() ()
#171171 0x0000000000909dc2 in symbol_table::finalize_compilation_unit() ()
#171172 0x0000000000ef3262 in compile_file() ()
#171173 0x0000000000ef1c86 in do_compile() ()
#171174 0x0000000000ef169a in toplev::main(int, char**) ()
#171175 0x000000000190c540 in main ()

Reply via email to