)]}'
{
  "commit": "740f6ebc5c61bef4c7dd9b9c6addc1946181f047",
  "tree": "8b53fc23c2e905f9e961f7257f0b2fe822bdfc98",
  "parents": [
    "1bcce941ebbb9ad97997a86432da88c8a9117d4b"
  ],
  "author": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Sep 08 11:06:06 2026 +0200"
  },
  "committer": {
    "name": "Kyrylo Tkachov",
    "email": "ktkachov@nvidia.com",
    "time": "Tue Sep 15 08:40:07 2026 +0200"
  },
  "message": "builtins: Pass access direction to get_memory_rtx [PR127185]\n\nget_memory_rtx creates memory operands for both sources and destinations\nof string operations.  The memory attribute setter cannot infer the access\ndirection from the address expression.  Its conservative default therefore\nloses nontrapping information for known loads.  An inline memcmp source\nchanges from:\n\n  (mem:QI (...) [ this ])\n\nto:\n\n  (mem/c:QI (...) [ this ])\n\nAdd a required STORE_P argument to get_memory_rtx.  Mark destinations as\nstores and sources as loads at every caller.  This keeps precise nontrapping\ninformation for loads without using it for stores.\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 (get_memory_rtx): Add STORE_P.  Pass it to\n\tset_mem_attributes.\n\t(expand_builtin_memory_copy_args): Mark the destination as a store\n\tand the source as a load.\n\t(expand_movstr): Likewise.\n\t(expand_builtin_strncpy): Mark the destination as a store.\n\t(expand_builtin_memset_args): Likewise.\n\t(expand_builtin_memcmp): Mark both memory operands as loads.\n\t(expand_builtin_strcmp): Likewise.\n\t(expand_builtin_strncmp): Likewise.\n\t(inline_string_cmp): Mark the memory operand as a load.\n\t* builtins.h (get_memory_rtx): Add STORE_P.\n\t* internal-fn.cc (expand_RAWMEMCHR): Mark the memory operand as a\n\tload.\n\ngcc/testsuite/ChangeLog:\n\n\t* g++.dg/opt/mem-notrap-load-builtin.C: New test.\n\nSigned-off-by: Kyrylo Tkachov \u003cktkachov@nvidia.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "056fd20c4c6d13c2741b6939e487629f0559a62f",
      "old_mode": 33188,
      "old_path": "gcc/builtins.cc",
      "new_id": "02170d74ae9b16c0a8581f53afa7355761708f73",
      "new_mode": 33188,
      "new_path": "gcc/builtins.cc"
    },
    {
      "type": "modify",
      "old_id": "9cca88c647cc7d6b17b2959662c0d59546fc9491",
      "old_mode": 33188,
      "old_path": "gcc/builtins.h",
      "new_id": "97b79908d0dd39647b7b5536a00cbc74159bd15b",
      "new_mode": 33188,
      "new_path": "gcc/builtins.h"
    },
    {
      "type": "modify",
      "old_id": "c57b594ac591639236ddd7426c5f2caca9eff976",
      "old_mode": 33188,
      "old_path": "gcc/internal-fn.cc",
      "new_id": "eae0ca9bf51b0a794f3573d69ade6e660673e4ad",
      "new_mode": 33188,
      "new_path": "gcc/internal-fn.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "1e8bfa0c603af261ee825ec8c5e7862032891db8",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/opt/mem-notrap-load-builtin.C"
    }
  ]
}
