)]}'
{
  "commit": "091860deb606367e400ddb9a82b007bc45d75016",
  "tree": "2cf7fd202843dc7d357e96f5c872ce41031ec0a1",
  "parents": [
    "806fef866186c5c86a23ca7b1a11c2047589c890"
  ],
  "author": {
    "name": "Julian Brown",
    "email": "julian@codesourcery.com",
    "time": "Tue May 18 10:22:56 2021 -0700"
  },
  "committer": {
    "name": "Julian Brown",
    "email": "julian@codesourcery.com",
    "time": "Wed May 19 15:05:25 2021 -0700"
  },
  "message": "[og10] Rework indirect struct handling for OpenACC in gimplify.c\n\nThis patch reworks indirect struct handling in gimplify.c (i.e. for\nstruct components mapped with \"mystruct-\u003ea[0:n]\", \"mystruct-\u003eb\", etc.),\nfor OpenACC.  The key observation leading to these changes was that\ncomponent mappings of references-to-structures is already implemented\nand working, and indirect struct component handling via a pointer can\nwork quite similarly.  That lets us remove some earlier, special-case\nhandling for mapping indirect struct component accesses for OpenACC,\nwhich required the pointed-to struct to be manually mapped before the\nindirect component mapping.\n\nWith this patch, you can map struct components directly (e.g. an array\nslice \"mystruct-\u003ea[0:n]\") just like you can map a non-indirect struct\ncomponent slice (\"mystruct.a[0:n]\"). Both references-to-pointers (with\nthe former syntax) and references to structs (with the latter syntax)\nwork now.\n\nFor Fortran class pointers, we no longer re-use GOMP_MAP_TO_PSET for the\nclass metadata (the structure that points to the class data and vptr)\n-- it is instead treated as any other struct.\n\nFor C++, the struct handling also works for class members (\"this-\u003efoo\"),\nwithout having to explicitly map \"this[:1]\" first.\n\nFor OpenACC, we permit chained indirect component references\n(\"mystruct-\u003ea-\u003eb[0:n]\"), though only the last part of such mappings will\ntrigger an attach/detach operation.  To properly use such a construct\non the target, you must still manually map \"mystruct-\u003ea[:1]\" first --\nbut there\u0027s no need to map \"mystruct[:1]\" explicitly before that.\n\nThis version of the patch avoids altering code paths for OpenMP,\nwhere possible.\n\n2021-05-19  Julian Brown  \u003cjulian@codesourcery.com\u003e\n\ngcc/fortran/\n\t* trans-openmp.c (gfc_trans_omp_clauses): Don\u0027t create GOMP_MAP_TO_PSET\n\tmappings for class metadata, nor GOMP_MAP_POINTER mappings for\n\tPOINTER_TYPE_P decls.\n\ngcc/\n\t* gimplify.c (extract_base_bit_offset): Add BASE_IND and OPENMP\n\tparameters.  Handle pointer-typed indirect references for OpenACC\n\talongside reference-typed ones.\n\t(strip_components_and_deref, aggregate_base_p): New functions.\n\t(build_struct_group): Add pointer type indirect ref handling,\n\tincluding chained references, for OpenACC.  Also handle references to\n\tstructs for OpenACC.  Conditionalise bits for OpenMP only where\n\tappropriate.\n\t(gimplify_scan_omp_clauses): Rework pointer-type indirect structure\n\taccess handling to work more like the reference-typed handling for\n\tOpenACC only.\n\t* omp-low.c (scan_sharing_clauses): Handle pointer-type indirect struct\n\treferences, and references to pointers to structs also.\n\ngcc/testsuite/\n\t* g++.dg/goacc/member-array-acc.C: New test.\n\t* g++.dg/gomp/member-array-omp.C: New test.\n\nlibgomp/\n\t* testsuite/libgomp.oacc-c-c++-common/deep-copy-15.c: New test.\n\t* testsuite/libgomp.oacc-c-c++-common/deep-copy-16.c: New test.\n\t* testsuite/libgomp.oacc-c++/deep-copy-17.C: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d3667031ca96cf04c04431cfe138472f1d82b50d",
      "old_mode": 33188,
      "old_path": "gcc/fortran/trans-openmp.c",
      "new_id": "85b09514b1c55050484d7d5f4507b1dd54611b27",
      "new_mode": 33188,
      "new_path": "gcc/fortran/trans-openmp.c"
    },
    {
      "type": "modify",
      "old_id": "bb87128bcdf4c6586cb62ac4fdaf13ea2f5a52f9",
      "old_mode": 33188,
      "old_path": "gcc/gimplify.c",
      "new_id": "07baf4d47ba3f5534958b647e4f9423d2aca75c7",
      "new_mode": 33188,
      "new_path": "gcc/gimplify.c"
    },
    {
      "type": "modify",
      "old_id": "64b7c19ff39c5c221d2f0f5364f32143ff792f2a",
      "old_mode": 33188,
      "old_path": "gcc/omp-low.c",
      "new_id": "bb473d58f12b3ede88fbb4395d8939f37a169aaf",
      "new_mode": 33188,
      "new_path": "gcc/omp-low.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "e0c11570f5dc5314137efc9f9bb07ff39db524b2",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/goacc/member-array-acc.C"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a53aa44592dd51a32d0aed74aeb30a68367ec002",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/gomp/member-array-omp.C"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "dacbb520f3d892e7e6c0cc94ae7d8693e856be42",
      "new_mode": 33188,
      "new_path": "libgomp/testsuite/libgomp.oacc-c++/deep-copy-17.C"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "27fe1a9d07ddb2b3dd70c085dd4719573db7064f",
      "new_mode": 33188,
      "new_path": "libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-15.c"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a7308e8c98b95cf7102d0da865796cf2fa2b2ff9",
      "new_mode": 33188,
      "new_path": "libgomp/testsuite/libgomp.oacc-c-c++-common/deep-copy-16.c"
    }
  ]
}
