)]}'
{
  "commit": "a1f8dca201ee08f526342ca9cdf022a9ea92e1b3",
  "tree": "9ee43b0559207355e52b796439a36522b825403e",
  "parents": [
    "50a42922d35343116d02c11f550b722105d4bdb7"
  ],
  "author": {
    "name": "Szabolcs Nagy",
    "email": "szabolcs.nagy@arm.com",
    "time": "Wed Jan 15 12:23:40 2020 +0000"
  },
  "committer": {
    "name": "Szabolcs Nagy",
    "email": "szabolcs.nagy@arm.com",
    "time": "Wed Jan 29 14:31:50 2020 +0000"
  },
  "message": "[AArch64] PR92424: Fix -fpatchable-function-entry\u003dN,M with BTI\n\nThis is a workaround that emits a BTI after the function label if that\nis followed by a patch area. We try to remove the BTI that follows the\npatch area (this may fail e.g. if the first instruction is a PACIASP).\n\nSo before this commit -fpatchable-function-entry\u003d3,1 with bti generates\n\n    .section __patchable_function_entries\n    .8byte .LPFE\n    .text\n  .LPFE:\n    nop\n  foo:\n    nop\n    nop\n    bti c // or paciasp\n    ...\n\nand after this commit\n\n    .section __patchable_function_entries\n    .8byte .LPFE\n    .text\n  .LPFE:\n    nop\n  foo:\n    bti c\n    nop\n    nop\n    // may be paciasp\n    ...\n\nand with -fpatchable-function-entry\u003d1 (M\u003d0) the code now is\n\n  foo:\n    bti c\n    .section __patchable_function_entries\n    .8byte .LPFE\n    .text\n  .LPFE:\n    nop\n    // may be paciasp\n    ...\n\nThere is a new bti insn in the middle of the patchable area users need\nto be aware of unless M\u003d0 (patch area is after the new bti) or M\u003dN\n(patch area is before the label, no new bti). Note: bti is not added to\nall functions consistently (it can be turned off per function using a\ntarget attribute or the compiler may detect that the function is never\ncalled indirectly), so if bti is inserted in the middle of a patch area\nthen user code needs to deal with detecting it.\n\nTested on aarch64-none-linux-gnu.\n\ngcc/ChangeLog:\n\n\tPR target/92424\n\t* config/aarch64/aarch64.c (aarch64_declare_function_name): Set\n\tcfun-\u003emachine-\u003elabel_is_assembled.\n\t(aarch64_print_patchable_function_entry): New.\n\t(TARGET_ASM_PRINT_PATCHABLE_FUNCTION_ENTRY): Define.\n\t* config/aarch64/aarch64.h (struct machine_function): New field,\n\tlabel_is_assembled.\n\ngcc/testsuite/ChangeLog:\n\n\tPR target/92424\n\t* gcc.target/aarch64/pr92424-2.c: New test.\n\t* gcc.target/aarch64/pr92424-3.c: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "bf3c477e562f13cfcfed472354b1471ff76b4aa1",
      "old_mode": 33188,
      "old_path": "gcc/ChangeLog",
      "new_id": "4e84692926f6cdc9ec31112e4db6c07850071c84",
      "new_mode": 33188,
      "new_path": "gcc/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "d2a74a7e9d85875be092a19e7675835dbc7cb4d5",
      "old_mode": 33188,
      "old_path": "gcc/config/aarch64/aarch64.c",
      "new_id": "26a28570be9f7a9d99488f2851bbe09228e55a95",
      "new_mode": 33188,
      "new_path": "gcc/config/aarch64/aarch64.c"
    },
    {
      "type": "modify",
      "old_id": "fc6df970c2e759b4f1975cb94e0f8b4b6612b75c",
      "old_mode": 33188,
      "old_path": "gcc/config/aarch64/aarch64.h",
      "new_id": "772a97296880688c13a3421a3d1c822444cb4a33",
      "new_mode": 33188,
      "new_path": "gcc/config/aarch64/aarch64.h"
    },
    {
      "type": "modify",
      "old_id": "5b0b1b937228f684a9043c0290516703b53b88a0",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/ChangeLog",
      "new_id": "f17f7f44a2e370efe04811c7f457f5cd25a5743e",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/ChangeLog"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0e75657a15371533c8d75dbb3a730b81ea6e67a0",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/aarch64/pr92424-2.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0a1f74d4096220ac69dec0886bbe4f6c5d174378",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/aarch64/pr92424-3.c"
    }
  ]
}
