)]}'
{
  "commit": "a32b49435b4e3d6bb2510197f2ee4b3ff887cd62",
  "tree": "54141d93e0baa7610ff68aa5c974e5ea51d21715",
  "parents": [
    "65ba830f4ec193acd44f738217ff36490ead67b3"
  ],
  "author": {
    "name": "Richard Biener",
    "email": "rguenther@suse.de",
    "time": "Wed Jul 15 10:04:18 2026 +0200"
  },
  "committer": {
    "name": "Richard Biener",
    "email": "rguenther@suse.de",
    "time": "Fri Jul 24 12:13:59 2026 +0200"
  },
  "message": "tree-optimization/126171 - SCEV and minus of INT_MIN\n\nThe following fixes the existing mitigation against UB for handling\nof subtraction of the most negative value in a type.  We\u0027ve only\nguarded the negation itself which is effective for avoiding UB in\nthat but it does not help in fixing a wrong scev_direction that\nresults from flipping the operation from minus to plus.  So the\npatch, instead of only promoting the negation to unsigned, promotes\nthe whole operation.\n\n\tPR tree-optimization/126171\n\t* tree-scalar-evolution.cc (scev_dfs::add_to_evolution):\n\tRemove code argument.  Remove MINUS_EXPR handling here.\n\t(scev_dfs::follow_ssa_edge_binary): Likewise.\n\t(scev_dfs::follow_ssa_edge_expr): Handle MINUS_EXPR\n\tseparately here, promoting the whole operation to unsigned\n\tinstead of just the addend.\n\n\t* gcc.dg/pr126171-1.c: New testcase.\n\t* gcc.dg/torture/pr126171-2.c: Likewise.\n\n(cherry picked from commit 2fcbe075ec3b32f4a523ebae68a8a32381bb46a9)\n",
  "tree_diff": [
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "4ac67c87c7d5b57c4549b216bac448b19c1e1e6c",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/pr126171-1.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "82df6bfef9b3464ff7b01c73583e9be60e4dc327",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/torture/pr126171-2.c"
    },
    {
      "type": "modify",
      "old_id": "5076ce446c13063685749617be38e5ec9f70c169",
      "old_mode": 33188,
      "old_path": "gcc/tree-scalar-evolution.cc",
      "new_id": "dcbec9c7a87bca962387047fe6699b724827299f",
      "new_mode": 33188,
      "new_path": "gcc/tree-scalar-evolution.cc"
    }
  ]
}
