)]}'
{
  "commit": "7ae96151ed91609c331d7199e71cf14072c120fd",
  "tree": "a7a256d56727f5ed4305c33ba5ecbff3975916cc",
  "parents": [
    "50be38676af8ed32744b856ad6864302f7b400bc"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Thu Sep 03 18:27:04 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Sep 15 08:39:28 2026 +0200"
  },
  "message": "middle-end: Check GIMPLE memory LHSs as stores [PR127184]\n\ntree_could_trap_p describes evaluation as an rvalue.  However,\ngimple_could_trap_p_1 uses it for an assignment LHS when store checks are\nrequested.  It also scans the LHS of other statements as an rvalue.  A load\ncan be safe while a store to the same address can trap.\n\nUse gimple_store_p and lhs_could_trap_p for memory LHSs when store checks are\nrequested.  This keeps register definitions as non-stores and includes memory\nresults of GIMPLE_CALL.  Omit every statement LHS from the rvalue operand\nscan.\n\nA nothrow call statement can still trap when the caller stores its result.\nThe return-slot optimization flag permits direct construction in the\ndestination, but expansion can use a temporary and a caller-side copy.  Check\na memory call LHS when non-call exceptions are enabled.\n\nAdd self-tests for register definitions, assignment stores, and call result\nstores.  Add a non-call exception test for nothrow call results.\n\nBootstrapped and tested on aarch64-unknown-linux-gnu.  Tested on\nx86_64-pc-linux-gnu.\n\n\tPR middle-end/127184\n\ngcc/ChangeLog:\n\n\t* gimple.cc (gimple_could_trap_p_1): Check a memory LHS with\n\tlhs_could_trap_p.  Do not inspect an LHS as an rvalue.\n\t(test_could_trap): New self-test.\n\t(gimple_cc_tests): Run it.\n\t* tree-eh.cc (stmt_could_throw_p): Check a nothrow call\u0027s memory LHS.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/eh/noncall-store-call.C: New test.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3756a60a8e6e21e8533567295136f59fc10bc76c",
      "old_mode": 33188,
      "old_path": "gcc/gimple.cc",
      "new_id": "04ad17f59556d7e936ae14f93817df2f1a0c7694",
      "new_mode": 33188,
      "new_path": "gcc/gimple.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0be0151450b755488e05eec632398659a016a5d1",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/eh/noncall-store-call.C"
    },
    {
      "type": "modify",
      "old_id": "1a781f7a09078d01dcf3909548a48544c3523ff4",
      "old_mode": 33188,
      "old_path": "gcc/tree-eh.cc",
      "new_id": "e3b8db0b6d0194cd5e42378cfbe447096048f0ac",
      "new_mode": 33188,
      "new_path": "gcc/tree-eh.cc"
    }
  ]
}
