)]}'
{
  "commit": "f6e9ae4da8f040ab2ef2eb37d0fb4da6f823bf81",
  "tree": "32b27916fd47d1abadcc494f013b218c9c52f167",
  "parents": [
    "92483696301368d028bc4b570dbba53cdfdce609"
  ],
  "author": {
    "name": "Tamar Christina",
    "email": "tamar.christina@arm.com",
    "time": "Tue Feb 11 10:50:12 2020 +0000"
  },
  "committer": {
    "name": "Tamar Christina",
    "email": "tamar.christina@arm.com",
    "time": "Tue Feb 11 10:50:15 2020 +0000"
  },
  "message": "middle-end: Fix logical shift truncation (PR rtl-optimization/91838) (gcc-9 backport)\n\nThis fixes a fall-out from a patch I had submitted two years ago which started\nallowing simplify-rtx to fold logical right shifts by offsets a followed by b\ninto \u003e\u003e (a + b).\n\nHowever this can generate inefficient code when the resulting shift count ends\nup being the same as the size of the shift mode.  This will create some\nundefined behavior on most platforms.\n\nThis patch changes to code to truncate to 0 if the shift amount goes out of\nrange.  Before my older patch this used to happen in combine when it saw the\ntwo shifts.  However since we combine them here combine never gets a chance to\ntruncate them.\n\nThe issue mostly affects GCC 8 and 9 since on 10 the back-end knows how to deal\nwith this shift constant but it\u0027s better to do the right thing in simplify-rtx.\n\nNote that this doesn\u0027t take care of the Arithmetic shift where you could replace\nthe constant with MODE_BITS (mode) - 1, but that\u0027s not a regression so punting it.\n\ngcc/ChangeLog:\n\n\tBackport from mainline\n\t2020-01-31  Tamar Christina  \u003ctamar.christina@arm.com\u003e\n\n\tPR rtl-optimization/91838\n\t* simplify-rtx.c (simplify_binary_operation_1): Update LSHIFTRT case\n\tto truncate if allowed or reject combination.\n\ngcc/testsuite/ChangeLog:\n\n\tBackport from mainline\n\t2020-01-31  Tamar Christina  \u003ctamar.christina@arm.com\u003e\n\t\t    Jakub Jelinek  \u003cjakub@redhat.com\u003e\n\n\tPR rtl-optimization/91838\n\t* g++.dg/opt/pr91838.C: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "352a539002d320417e5d2a970eaefd995eefe488",
      "old_mode": 33188,
      "old_path": "gcc/ChangeLog",
      "new_id": "1916dab20d19caa2bf6b4163933235a30272b907",
      "new_mode": 33188,
      "new_path": "gcc/ChangeLog"
    },
    {
      "type": "modify",
      "old_id": "89a46a933facaded1b23a84fa9a0924595b01e5a",
      "old_mode": 33188,
      "old_path": "gcc/simplify-rtx.c",
      "new_id": "50bbb79655b5396aa76c0532b33036e722410b97",
      "new_mode": 33188,
      "new_path": "gcc/simplify-rtx.c"
    },
    {
      "type": "modify",
      "old_id": "31143d2ecbf02f7d9c6bc231d3cf0ff542ec7ae5",
      "old_mode": 33188,
      "old_path": "gcc/testsuite/ChangeLog",
      "new_id": "1dcf894a92a087cfccd08b220bf9eb2ef2d15bec",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/ChangeLog"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "fdf48094ade0befacc6126b65ab4a6a453c31470",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/g++.dg/opt/pr91838.C"
    }
  ]
}
