)]}'
{
  "commit": "463b464435db593bf4c2f8a89482eac2d7fa77e4",
  "tree": "4666f0491d9b11c733e37f7b94a28c4d5bd6a9a6",
  "parents": [
    "4972dc83ac449956ec79f32d644331003f4b641f"
  ],
  "author": {
    "name": "Mikael Morin",
    "email": "mikael@gcc.gnu.org",
    "time": "Mon Jul 20 15:07:25 2026 +0200"
  },
  "committer": {
    "name": "Mikael Morin",
    "email": "mikael@gcc.gnu.org",
    "time": "Mon Jul 20 15:07:25 2026 +0200"
  },
  "message": "fortran: Don\u0027t reuse original descriptors for packed arrays [PR125998]\n\nDon\u0027t try to reuse the original descriptor when creating a descriptor\nfor packed data in gfc_conv_array_parameter.\n\nFor a non-transposed array (anything but TRANSPOSE(VAR)) the original\ndescriptor was reused, and only the data was reset to the result of\npacking.  This is wrong because the original descriptor can be\nnon-contiguous, it can\u0027t be correct as the descriptor of packed data.\nIn the testcase, a dummy array associated with a transposed array actual\nargument matches this case.  Reusing the descriptor in that case would\ncause the packed data to be used transposed, that is not in the normal\narray element order.  This change removes this case to always fallback\nto what was previously the transposed case (see next).\n\nFor the transposed case (TRANSPOSE(VAR)), the full dimensions of the\noriginal untransposed descriptor were reused (in other words, the\ndimensions of VAR).  This is wrong because packing doesn\u0027t change the\nshape, so the packed array should have the same bounds as the bounds\nof TRANSPOSE(VAR), not the same bounds as VAR.  Reusing the strides of\nan unpacked array for a packed array doesn\u0027t seem right either.  This\nchange uses matching dimensions when copying from the original\ndescriptor, and only copies the lbound and ubound.  The strides are\nrecalculated.  And then the offset is recalculated as well (even though\nI couldn\u0027t find a testcase where it made a difference).\n\n\tPR fortran/97592\n\tPR fortran/125998\n\ngcc/fortran/ChangeLog:\n\n\t* trans-array.cc (gfc_conv_array_parameter): Always create a new\n\tdescriptor.  Copy lbound and ubound from the original descriptor\n\tusing matching dimension indexes.  Recalculate stride and\n\toffset.\n\ngcc/testsuite/ChangeLog:\n\n\t* gfortran.dg/contiguous_17.f90: New test.\n\n(cherry picked from commit 6658c2347d4a88d82e80f44a450b14dc7287bcef)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "023f38388742de24526ea085c5a9c5d7757d16f1",
      "old_mode": 33188,
      "old_path": "gcc/fortran/trans-array.cc",
      "new_id": "45787ee0021c591eeb3e123e8ebcdbc989b8cd31",
      "new_mode": 33188,
      "new_path": "gcc/fortran/trans-array.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0fd27b1d41e0ceb87dd64a7e89e25582ea272395",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gfortran.dg/contiguous_17.f90"
    }
  ]
}
