)]}'
{
  "commit": "33cd7bbb32c5eee4aff7aa06f351aa983be419bc",
  "tree": "c08f28e82685d6e6ef337d2239855ddcbb5b287c",
  "parents": [
    "8b45b008f07892bdb9765d7bbbf718c7bb78b8b1"
  ],
  "author": {
    "name": "Avinal Kumar",
    "email": "avinal.xlvii@gmail.com",
    "time": "Thu May 21 15:54:12 2026 +0530"
  },
  "committer": {
    "name": "Andrew Pinski",
    "email": "andrew.pinski@oss.qualcomm.com",
    "time": "Thu May 21 21:48:00 2026 -0700"
  },
  "message": "match: Handle X !\u003d INT_MIN ? -X : INT_MIN [PR125050]\n\nThe pattern X !\u003d C1 ? -X : C2 currently bails out when C1 is\nINT_MIN and the type doesn\u0027t wrap, because a signed negation\nof INT_MIN is undefined behavior.  But the whole expression is\nwell-defined: it is equivalent to (signed)(-(unsigned)X).\n\nHandle the wi::only_sign_bit_p case by emitting an unsigned\nnegate instead of giving up, mirroring what the abs pattern\nalready does for the same edge case.\n\n\tPR tree-optimization/125050\n\ngcc/ChangeLog:\n\n\t* match.pd: (X !\u003d C1 ? -X : C2): Handle C1 being INT_MIN\n\tby emitting (signed)(-(unsigned)X) instead of bailing out.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.dg/fold-condneg-2.c: Update expected optimization.\n\t* gcc.dg/pr125050.c: New test.\n\t* gcc.dg/tree-ssa/phi-opt-50.c: New test.\n\t* gcc.dg/tree-ssa/phi-opt-51.c: New test.\n\nSigned-off-by: Avinal Kumar \u003cavinal.xlvii@gmail.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "195d10c80c73fbfa4bf03f9415038c5962d13d84",
      "old_mode": 33188,
      "old_path": "gcc/match.pd",
      "new_id": "c6272c1e24ea152f3870fadfc11f8a706696b43c",
      "new_mode": 33188,
      "new_path": "gcc/match.pd"
    },
    {
      "type": "modify",
      "old_id": "1af24636ec764eedde843e4274e9bbb439aa3197",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/gcc.dg/fold-condneg-2.c",
      "new_id": "932f883a6e278165869c36c0830da499ddf4d20d",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/fold-condneg-2.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5f2009a7b4deb9a81204804ce67521a17c33b1ff",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/pr125050.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "3cfb768c1d955794a9cfc34277d2903def0475e0",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/phi-opt-50.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "6c5809f6ddf1912e030c6a6f8de0afde011ae38f",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/tree-ssa/phi-opt-51.c"
    }
  ]
}
