)]}'
{
  "commit": "a0cbca7aefb94b0241e706fe737e0326eead413d",
  "tree": "2b149f999071e7304cba84480cc408bf824a2964",
  "parents": [
    "dbda2911da5be5e11b7c776893fbc96938acf3ce"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Mon Sep 14 10:33:55 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Sep 15 08:40:21 2026 +0200"
  },
  "message": "strub: Preserve load MEM_NOTRAP for watermarks [PR127185]\n\nexpand_builtin_strub_update expands a watermark with EXPAND_MEMORY because\nit needs a MEM.  The same MEM is first loaded for a comparison and can then\nbe the destination of a store.  EXPAND_MEMORY has conservative store\nsemantics, so the load loses its valid MEM_NOTRAP flag:\n\n  (set (reg:DI ...)\n       (mem/f:DI (... watermark_ptr ...)))\n  (set (mem/f:DI (... watermark_ptr ...))\n       (reg:DI ...))\n\nMake a shallow copy for the load and derive its MEM_NOTRAP flag with load\ntrap semantics.  Keep the original MEM for the store:\n\n  (set (reg:DI ...)\n       (mem/f/c:DI (... watermark_ptr ...)))\n  (set (mem/f:DI (... watermark_ptr ...))\n       (reg:DI ...))\n\nThis keeps the memory-result requirement and does not mark the conditional\nstore as nontrapping.  Apply load trap semantics to the load-only watermarks\nin expand_builtin_strub_leave as well.\n\nTighten the existing update test so that it identifies the load and store\npositions independently of the target mode and MEM flag order.  Add a nested\nat-calls test that checks the incoming watermark loads from both update and\nleave.\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* builtins.cc (expand_builtin_strub_update): Use a separate MEM with\n\tload trap semantics for each watermark load.\n\t(expand_builtin_strub_leave): Use load trap semantics for watermark\n\tMEMs.\n\ngcc/testsuite/ChangeLog:\n\n\t* c-c++-common/strub-mem-notrap.c: Tighten the load and store scans.\n\t* c-c++-common/strub-mem-notrap-leave.c: New test.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "02170d74ae9b16c0a8581f53afa7355761708f73",
      "old_mode": 33188,
      "old_path": "gcc/builtins.cc",
      "new_id": "f2e21a57a59debf6897f3f89dd9e7d1454a53ff6",
      "new_mode": 33188,
      "new_path": "gcc/builtins.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "246c4c2088f322a9cd97bfeaa9df5ca3eac57b16",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/c-c++-common/strub-mem-notrap-leave.c"
    },
    {
      "type": "modify",
      "old_id": "ef9bbc39535a836d91c2220adba4879206f91995",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/c-c++-common/strub-mem-notrap.c",
      "new_id": "e0f4fe7b34d88918e6934de012609b47e7247e44",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/c-c++-common/strub-mem-notrap.c"
    }
  ]
}
