)]}'
{
  "commit": "9d59dcff40a4f39ee82f9c59a67f9466d7a8bc66",
  "tree": "3da9e08a271bc149a4a168ab6edc763bf7ceeeae",
  "parents": [
    "48a94d04c984457797693bd454ff01f916dda99c"
  ],
  "author": {
    "name": "Shivam Gupta",
    "email": "shivam98.tkg@gmail.com",
    "time": "Sat Aug 15 12:06:22 2026 +0530"
  },
  "committer": {
    "name": "Richard Biener",
    "email": "rguenth@gcc.gnu.org",
    "time": "Tue Aug 18 09:21:03 2026 +0200"
  },
  "message": "match.pd: Simplify (~A \u0026 1) \u003d\u003d (~B \u0026 1) at -O1 [PR112533]\n\nAt -O1, GCC lowers (~a \u0026 1) \u003d\u003d (~b \u0026 1) into two different GIMPLE\nforms depending on whether the boolean values come from a function\nreturn boundary or an inline expression:\n\n  1. Via function return (e.g. inlined is_even), GCC preserves the\n     eq/ne form because the function boundary hides the internal\n     structure from the gimplifier:\n       ((a\u00261)\u003d\u003d0) \u003d\u003d ((b\u00261)\u003d\u003d0)   outer node is eq/ne\n\n  2. Via inline expression (directly written), GCC sees the full\n     boolean expression tree at once and folds to bit_xor during\n     gimplification:\n       ((a\u00261)!\u003d0) ^ ((b\u00261)\u003d\u003d0)   outer node is bit_xor\n\nAdd a generalized match.pd rule handling:\n  1. ((x \u0026 c) \u003d\u003d 0) OP ((y \u0026 c) \u003d\u003d 0)\n  2. ((x \u0026 c) !\u003d 0) OP ((y \u0026 c) \u003d\u003d 0)\n\nfor OP in { \u003d\u003d, !\u003d, ^ } and pow2 masks.\n\nFold these directly into the canonical xor-mask form:\n  ((x ^ y) \u0026 c) \u003d\u003d 0\n  ((x ^ y) \u0026 c) !\u003d 0\n\nBootstrapped and tested on aarch64-linux-gnu with\nRUNTESTFLAGS\u003d\"tree-ssa.exp\".\n\nChanges since v1:\n* v5: Add :s to the inner comparisons and bit_and expressions.\n      Simplify the innersame check to compare icmp0 and icmp1\n      directly.\n\n* v4: Removed the ((x \u0026 c) \u003d\u003d 0) OP (y \u0026 c) simplify rule and\n      mark the corresponding test case as XFAIL.\n\n* v3: Collapse both previous simplify rules into one generalized\n      matcher covering all combinations of outer {eq, ne, bit_xor}\n      and inner {eq, ne} comparisons.\n      Add missing mixed-polarity test cases.\n\n* v2: Generalize mask from integer_onep to integer_pow2p.\n      Combine both patterns into single one.\n      Split test into bool-eq-evenness.c, bool-eq-bitxor.c,\n      bool-eq-pow2.c.\n\n\tPR tree-optimization/112533\n\ngcc/ChangeLog:\n\t* match.pd: Canonicalize boolean comparisons of masked pow2\n\tbits into xor-mask tests.\n\ngcc/testsuite/ChangeLog:\n\t* gcc.dg/tree-ssa/bool-eq-bitxor.c: New test.\n\t* gcc.dg/tree-ssa/bool-eq-evenness.c: New test.\n\t* gcc.dg/tree-ssa/bool-eq-pow2.c: New test.\n\nSigned-off-by: Shivam Gupta \u003cshivam98.tkg@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "18d295ad4cbc3090dd8e275b66521e716bfe791e",
      "old_mode": 33188,
      "old_path": "gcc/match.pd",
      "new_id": "665e8eede7f24acfdbd6d96818abb2955e3800c8",
      "new_mode": 33188,
      "new_path": "gcc/match.pd"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bc263e809770ba75fcaed9bdef42aa5b008e204c",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/bool-eq-bitxor.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "75df70dc6a4be4caf953f6fc637c17872768fe06",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/bool-eq-evenness.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "109c5f0361009ac7218fb988448630b3473bde75",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/bool-eq-pow2.c"
    }
  ]
}
