)]}'
{
  "commit": "dbda2911da5be5e11b7c776893fbc96938acf3ce",
  "tree": "5726bcb5db3b13a805377abf5286bc7823277f13",
  "parents": [
    "740f6ebc5c61bef4c7dd9b9c6addc1946181f047"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Mon Sep 14 11:56:09 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Sep 15 08:40:14 2026 +0200"
  },
  "message": "middle-end: Restore MEM_NOTRAP for memory-only loads [PR127185]\n\nEXPAND_MEMORY requires a MEM result but does not state whether the access\nis a load or a store.  Its conservative store semantics avoid unsafe\nMEM_NOTRAP claims, but two known load callers lose valid nontrapping\ninformation.\n\nOn this patch\u0027s parent, a memory-only inline asm input is:\n\n  (mem/u:SI (...) [ input+0 ])\n\nRestore its load semantics:\n\n  (mem/u/c:SI (...) [ input+0 ])\n\nThe partial-load expander has the same problem.  It uses EXPAND_WRITE even\nthough its MEM is the source of a masked or length-limited load.  Its source\nMEM changes from:\n\n  (mem/u:V4SI (...))\n\nto:\n\n  (mem/u/c:V4SI (...))\n\nUse EXPAND_MEMORY for partial loads because they require a MEM, then set\nMEM_NOTRAP from tree_could_trap_p at both caller sites.\n\nBootstrapped and tested on aarch64-unknown-linux-gnu.  Tested on\nx86_64-pc-linux-gnu.\n\n\tPR middle-end/127185\n\ngcc/ChangeLog:\n\n\t* cfgexpand.cc (expand_asm_stmt): Restore load MEM_NOTRAP for memory\n\tinputs.\n\t* internal-fn.cc: Include tree-eh.h.\n\t(expand_partial_load_optab_fn): Expand the source as memory and\n\trestore load MEM_NOTRAP.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/opt/mem-notrap-load-asm.C: New test.\n\t* gcc.target/i386/mem-notrap-mask-load.c: New test.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "245ba357b5ef8b34f84bfc5147075afaee3e1687",
      "old_mode": 33188,
      "old_path": "gcc/cfgexpand.cc",
      "new_id": "4bd311b11a345901670a66a4a54edd554517c658",
      "new_mode": 33188,
      "new_path": "gcc/cfgexpand.cc"
    },
    {
      "type": "modify",
      "old_id": "eae0ca9bf51b0a794f3573d69ade6e660673e4ad",
      "old_mode": 33188,
      "old_path": "gcc/internal-fn.cc",
      "new_id": "3fdf89e0e6e1b3884c43304fe95a212bdad92586",
      "new_mode": 33188,
      "new_path": "gcc/internal-fn.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "797d6793c0d3539f3bcf658d53ac9b775869413e",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/opt/mem-notrap-load-asm.C"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bc510e6ad4f7ff7a8d2476a708e43ca9e5e10b14",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/i386/mem-notrap-mask-load.c"
    }
  ]
}
