)]}'
{
  "commit": "f4d19f74bcd0ca496de729b46dd2d8a80fda1d29",
  "tree": "64c890d3881b2fc7ea22a136b69602ecd2a55e4d",
  "parents": [
    "e7399b9d4225f54e000c7252f7aedf7580caa113"
  ],
  "author": {
    "name": "Jakub Jelinek",
    "email": "jakub@redhat.com",
    "time": "Thu Nov 27 20:18:57 2025 +0100"
  },
  "committer": {
    "name": "Jakub Jelinek",
    "email": "jakub@gcc.gnu.org",
    "time": "Mon Dec 08 08:07:48 2025 +0100"
  },
  "message": "c: Fix ICE in c_type_tag on va_list [PR121506]\n\nThe C and C++ FEs disagree on what TYPE_NAME on RECORD_TYPE for\nstructure/class definition is (rather than typedef/using, for\nthose both have TYPE_NAME of TYPE_DECL with DECL_ORIGINAL_TYPE),\nthe C FE just uses IDENTIFIER_NODE as TYPE_NAME on RECORD_TYPE,\nwhile the C++ FE uses TYPE_DECL as TYPENAME on RECORD_TYPE and\nonly DECL_NAME on the TYPE_DECL provides the IDENTIFIER_NODE.\nThe reason for the C++ FE way is that there can be type definitions\nat class scope (rather than just typedefs) and those need to be\namong TYPE_FIELDS (so the corresponding TYPE_DECL is in that chain)\netc.\nThe middle-end can cope with it, e.g.\n                if (TREE_CODE (TYPE_NAME (node)) \u003d\u003d IDENTIFIER_NODE)\n                  pp_tree_identifier (pp, TYPE_NAME (node));\n                else if (TREE_CODE (TYPE_NAME (node)) \u003d\u003d TYPE_DECL\n                         \u0026\u0026 DECL_NAME (TYPE_NAME (node)))\n                  dump_decl_name (pp, TYPE_NAME (node), flags);\nand many other places.\nNow, the backends on various targets create artificial structure\ndefinitions for va_list, e.g. x86 creates struct __va_list_tag\nand they do it the C++ FE way so that the C++ FE can cope with those.\nExcept the new c_type_tag can\u0027t deal with that and ICEs.\n\nThe following patch fixes it so that it can handle it too.\n\n2025-11-27  Jakub Jelinek  \u003cjakub@redhat.com\u003e\n\n\tPR c/121506\n\t* c-typeck.cc (c_type_tag): If TYPE_NAME is TYPE_DECL\n\twith non-NULL DECL_NAME, return that.\n\n\t* gcc.dg/pr121506.c: New test.\n\n(cherry picked from commit ca19686a6b87696c0ecea5e9fce825b5e5e10144)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "b007c8ffe7668c87aebeaa15016609098474fdf9",
      "old_mode": 33188,
      "old_path": "gcc/c/c-typeck.cc",
      "new_id": "944e75a83e47bc0463ea07a0799afc380199ad05",
      "new_mode": 33188,
      "new_path": "gcc/c/c-typeck.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "0d0664739acaa5a33fc0e034d53de1dcfdbee606",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/pr121506.c"
    }
  ]
}
