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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Richard Biener from comment #4)
> so quite hard if not impossible to "fix" in genemit

The most complex one I saw in action was mod<mode>3 in aarch64.md:
(define_expand "mod<mode>3"
  [(match_operand:GPI 0 "register_operand")
   (match_operand:GPI 1 "register_operand")
   (match_operand:GPI 2 "const_int_operand")]

Where the pattern in the expand is not going to be used at all (obviously) but
has a conditional FAIL and then an unconditional DONE.
    if (val <= 0
       || exact_log2 (val) <= 0
       || !aarch64_bitmask_imm (val - 1, <MODE>mode))
      FAIL;
....
    rtx masked_neg = gen_reg_rtx (<MODE>mode);
    emit_insn (gen_and<mode>3 (masked_neg, neg_op, mask));

    emit_insn (gen_csneg3<mode>_insn (operands[0], cond,
                                       masked_neg, masked_pos));
    DONE;


And even splits will have issues too. See "*compare_condjump<GPI:mode>" in
aarch64 where the pattern in the split will not be used but then there is an
unconditional DONE:
    emit_jump_insn (gen_condjump (cmp_rtx, cc_reg, operands[2]));
    DONE;


I think we should just close this as won't fix and add -Wno-unreachable-code
while compiling the generated C file.

Reply via email to