[Bug target/78748] [7 Regression] ICE in extract_insn, at recog.c:2311 (s390x-linux-gnu)

jakub at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Dec 9 17:21:00 GMT 2016


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

--- Comment #3 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 40292
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=40292&action=edit
gcc7-pr78748.patch

Untested fix (though, I don't have a quick setup to bootstrap/regtest it in the
next week or so).

The bug seems to be that if reg_overlap_mentioned_p returns true in between op0
and op2, perhaps better testcase for that would be:
/* PR target/78748 */

void
foo (int *p, int *q)
{
  *q = *p & ~*q;
}

void
bar (int *p, int *q)
{
  *q = ~*p & *q;
}

where indeed there is a potential overlap in between the two, then the op1 &
op2 result is forced into a pseudo, but if op0 is a MEM that matched op1, that
means the xor violates s390_logical_operator_ok_p, as the destination does not
match any of the operands, even when it is a memory.

The patch makes sure it is either not a MEM, or matches op2, which appears in
both instructions.


More information about the Gcc-bugs mailing list