)]}'
{
  "commit": "b89ee9e63ce7dff24dfab95f8df123e71629f5ff",
  "tree": "71f4fa05515fc2700ac49f51fd9e7ca4a920c273",
  "parents": [
    "9540ef338dd498a249954ab74041b0ddf7804e09"
  ],
  "author": {
    "name": "Jakub Jelinek",
    "email": "jakub@redhat.com",
    "time": "Wed Jun 18 08:07:22 2025 +0200"
  },
  "committer": {
    "name": "Jakub Jelinek",
    "email": "jakub@gcc.gnu.org",
    "time": "Thu Jun 19 09:00:42 2025 +0200"
  },
  "message": "dfp, real: Fix up FLOAT_EXPR/FIX_TRUNC_EXPR constant folding between dfp and large _BitInt [PR120631]\n\nThe following testcase shows that while at runtime we handle conversions\nbetween _Decimal{64,128} and large _BitInt correctly, at compile time we\nmishandle them in both directions, in one direction we end up in ICE in\ndecimal_from_integer callee because the char buffer is too short for the\nneeded number of decimal digits, in the conversion of dfp to large _BitInt\nwe return 0 in the wide_int.\n\nThe following patch fixes the ICE by using larger buffer (XALLOCAVEC\nallocated, it will be never larger than 65536 / 3 bytes) in the larger\n_BitInt case, and the other direction by setting exponent to exp % 19\nand instead multiplying the result by needed powers of 10^19 (10^19 chosen\nas largest power of ten that can fit into UHWI).\n\n2025-06-18  Jakub Jelinek  \u003cjakub@redhat.com\u003e\n\n\tPR middle-end/120631\n\t* real.cc (decimal_from_integer): Add digits argument, if larger than\n\t256, use XALLOCAVEC allocated buffer.\n\t(real_from_integer): Pass val_in\u0027s precision divided by 3 to\n\tdecimal_from_integer.\n\t* dfp.cc (decimal_real_to_integer): For precision \u003e 128 if finite\n\tand exponent is large, decrease exponent and multiply resulting\n\twide_int by powers of 10^19.\n\n\t* gcc.dg/dfp/bitint-9.c: New test.\n\n(cherry picked from commit f3002d664d1137844c714645a841a48ab57d0eaa)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "5c2bf1ae068614333a453f7f99c4a0c8326d36c3",
      "old_mode": 33188,
      "old_path": "gcc/dfp.cc",
      "new_id": "4011a95db4af7e2608976fc0020e299ca960071f",
      "new_mode": 33188,
      "new_path": "gcc/dfp.cc"
    },
    {
      "type": "modify",
      "old_id": "95a933220b5d1092913e60f0be8e9dc85ee2bd17",
      "old_mode": 33188,
      "old_path": "gcc/real.cc",
      "new_id": "1f987d48889f44687a045547cecd405d07cfd3c9",
      "new_mode": 33188,
      "new_path": "gcc/real.cc"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "72155a01247536bb5e9d6f9d241ef795efc0418a",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.dg/dfp/bitint-9.c"
    }
  ]
}
