get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/1.1/patches/2225258/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2225258,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2225258/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260420180238.33599-1-daniel.barboza@oss.qualcomm.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.1/projects/17/?format=api",
        "name": "GNU Compiler Collection",
        "link_name": "gcc",
        "list_id": "gcc-patches.gcc.gnu.org",
        "list_email": "gcc-patches@gcc.gnu.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null
    },
    "msgid": "<20260420180238.33599-1-daniel.barboza@oss.qualcomm.com>",
    "date": "2026-04-20T18:02:38",
    "name": "[v3] match.pd: simplify lshift const cmp using bit_and [PR124019]",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e4f224d827ca9b4e96ec5412d487a8749ff5a813",
    "submitter": {
        "id": 92288,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/92288/?format=api",
        "name": "Daniel Barboza",
        "email": "daniel.barboza@oss.qualcomm.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260420180238.33599-1-daniel.barboza@oss.qualcomm.com/mbox/",
    "series": [
        {
            "id": 500657,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/500657/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=500657",
            "date": "2026-04-20T18:02:38",
            "name": "[v3] match.pd: simplify lshift const cmp using bit_and [PR124019]",
            "version": 3,
            "mbox": "http://patchwork.ozlabs.org/series/500657/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2225258/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2225258/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": [
            "incoming@patchwork.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@legolas.ozlabs.org",
            "gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=ZiFpEQGw;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=kcUZ8j8I;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=38.145.34.32; helo=vm01.sourceware.org;\n envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org;\n receiver=patchwork.ozlabs.org)",
            "sourceware.org;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256\n header.s=qcppdkim1 header.b=ZiFpEQGw;\n\tdkim=pass (2048-bit key,\n unprotected) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com\n header.a=rsa-sha256 header.s=google header.b=kcUZ8j8I",
            "sourceware.org; dmarc=none (p=none dis=none)\n header.from=oss.qualcomm.com",
            "sourceware.org;\n spf=pass smtp.mailfrom=oss.qualcomm.com",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=205.220.168.131"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fztdM2hgsz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 21 Apr 2026 04:03:18 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0B5D84C900D8\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 20 Apr 2026 18:03:16 +0000 (GMT)",
            "from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com\n [205.220.168.131])\n by sourceware.org (Postfix) with ESMTPS id 9F4BF4B358A2\n for <gcc-patches@gcc.gnu.org>; Mon, 20 Apr 2026 18:02:46 +0000 (GMT)",
            "from pps.filterd (m0279866.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63KG1h78785558\n for <gcc-patches@gcc.gnu.org>; Mon, 20 Apr 2026 18:02:45 GMT",
            "from mail-qk1-f198.google.com (mail-qk1-f198.google.com\n [209.85.222.198])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4dnhdhhwm3-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Mon, 20 Apr 2026 18:02:45 +0000 (GMT)",
            "by mail-qk1-f198.google.com with SMTP id\n af79cd13be357-8eabf08affaso323945885a.1\n for <gcc-patches@gcc.gnu.org>; Mon, 20 Apr 2026 11:02:45 -0700 (PDT)",
            "from QCOM-UWl2o8bcGT.qualcomm.com ([191.202.238.222])\n by smtp.gmail.com with ESMTPSA id\n af79cd13be357-8e7d64cbbdbsm914341085a.12.2026.04.20.11.02.41\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Mon, 20 Apr 2026 11:02:42 -0700 (PDT)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 0B5D84C900D8",
            "OpenDKIM Filter v2.11.0 sourceware.org 9F4BF4B358A2"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 9F4BF4B358A2",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 9F4BF4B358A2",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776708166; cv=none;\n b=TFGakovIeSwjJeWz9rAcH/ToovEsnrVpB6vgMweejmu/jl1bJ7pBKIb8f/oqrrQTPxMcc2RHeJm+p71YT2GSyC8+y8Iq4aj0+kk7N8yPY6eIQxNKjMuNgGml2W7ryjtuxEBunzu/pAD0k0wmZkRQ1O8NBdWFMrSDlsfZnI/nB84=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776708166; c=relaxed/simple;\n bh=2wZuEP073e63Zf9ANuLxzHjr73J0lT5SaUA4PK4IGWw=;\n h=DKIM-Signature:DKIM-Signature:From:To:Subject:Date:Message-ID:\n MIME-Version;\n b=RgZxf2xenJiKf8tfr6LaYEnoVA+36DJCqbMzdQuH5z1pMaBoJbHjvwKH1iCTs7vtInU5fIYZH4k8cekEuvasslLBiO0Y9hE69k8Et8dYiy52rNQoYSZNNjsrofynrwWhwrzrDtOjULFj6GQccs9gSblSob0S3Rx2ww4COUC1xeE=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h=\n cc:content-transfer-encoding:date:from:message-id:mime-version\n :subject:to; s=qcppdkim1; bh=NIjuGb1VuPebp4aYKCzqRVZjTeLMnChN06h\n Db1mp4+8=; b=ZiFpEQGwLWygbw2rqzWCHwe+D3bwbEwBRb+W8Vq/BRjnBtU1g/t\n uHyIKXLsM/TYg3T3C8KGP1htmY2OenQwzEtkNwtX0EzNuCUSpFx5TPTYKjfO8S8L\n QXxZNV4LkwMd/6E1IQXsvNgRz9RkAQiwh0Gen+RW8tCBu50nwNMoJXoyLqc1VAsd\n BFDD5G76ECHYN51XkQpo87fFIW5JhiqV/ob7Y30ps5RW9hzMsTXHHTzosnwTF8a7\n oT0p9Nz3caQLYivHKk9Q5f/ehET1wkKtpFO8XaGUhJL1lyiK+47BW+oD9daE2Rda\n 2Dm85mC/PqD9DGHXmmimWXi8UI3sXwQISWA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1776708163; x=1777312963; darn=gcc.gnu.org;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:from:to:cc:subject:date:message-id:reply-to;\n bh=NIjuGb1VuPebp4aYKCzqRVZjTeLMnChN06hDb1mp4+8=;\n b=kcUZ8j8ISNjTpSr+qQjVFMOO8nuLZcFDk5Qy5S+sSJPEKz2rYUPHhAxBYcC1MCpIUp\n m0jrm9Q8NfxMOmnO498UimAJzGpkfFiM1s6P8ckNfva+v+BvD1XdTXE1V7/FoAvk4jz5\n dF0BvrPi1sH0T1DXqcLWTkSZ36THCcUTdta16IznlRi2X2LFHAj6iSS9cGb8ca0Sh7rx\n r+fBiCEb52oodCH622W6cTAH9i+3msGJdZSB2MMwqxoH6PZVD5ZCJK8DVw74u3KgT+qx\n wqtfTRR84ttMgl1wdhzKwAacmXX7Sjxk70tEZlnw1r71qbp/zYx3eBULhr7yJdwqPhyn\n g9pw=="
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776708163; x=1777312963;\n h=content-transfer-encoding:mime-version:message-id:date:subject:cc\n :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date\n :message-id:reply-to;\n bh=NIjuGb1VuPebp4aYKCzqRVZjTeLMnChN06hDb1mp4+8=;\n b=RY8IbLQSIuZXAq5MjALCseVmuWVftScZXmUMZ6GlfFxUS0jckPSnX5NyabkIdddcQn\n s95OeZiuMI5EjL0WmaHTsF0UbDd27w/hZEfsr1lhK00kr9Pi5wCS4yLIvBV4TQDzTul/\n znL6UXXuFN8bOAcFrpigUbjJvkrD/cdL8LEaIg87khJmO+ojSOHAVRSl8dYP3/aWbmIN\n rFzPpEGAjB4lRe3tE5IAt4AoV49uAj6m/DFD2I6S44Slkg/JIFjkNLjyYjg2j2oM3Xu/\n ExR9NXDLdhgVP9SFOfk5GJhWwECz1NOjdHwX305KLN2j+JpGE4sTaURRs3X2mYMGjLVt\n dZVg==",
        "X-Gm-Message-State": "AOJu0YzR0Q6HAG0f/W8JXy1zMheycdvPPiOGH/bDWk1PmZENO6832pB0\n 9e7h+TsLzF/xZL6CeO5ux6GWl8A9tpSBU5ezkw/tN+aUALiao2QOeH1d4ckKzOHytvFtF+GtrUS\n AOnQBNtHAGVf9ErpS0McBIcfaxTl8jebZ6Z6EqGP1yHIh/7ennBIrHxTMFzqIGnPGGD1e",
        "X-Gm-Gg": "AeBDietjjmrYFhR4lFj0QIa13Bgwm1ynvI1vwZbHoi1mmRj9s01vQXH7oE/BtOT2UcU\n QoGj09+tQaDS6kzU2lgqeTGXEn7gnruwuUPigLlsCPe8tWmMWOBpIbYfaJ90GsrcVnjOAOvykLd\n fwcqKz3CLJyQTknhAt2sk7a1OgOn595wpeCovtlbVFui5HZbZoVuZ1qOUaDlz6QK1KLYsHBtRzr\n tFy477PVcDrjO1x2XboUvlcOCWR2KQgVxFOc4KQXhzCwMmv9e4JwInfSgMRW6iKsCDwn/6/RiA1\n Uywj3xYazuiw/64O6kvaDcqd+1l8DwSSo8rb7+SliQ1FBFBn4zDMZnRtAcGbyvpBO/nkVb7bA4n\n AJfN9JeQeVwSxz2fzFa11RoE4QovDa04Gj5Y8AFgN5O9qbqzqsFlFXFrFXx7/ME406xREp6E=",
        "X-Received": [
            "by 2002:a05:620a:454e:b0:8ec:7323:9361 with SMTP id\n af79cd13be357-8ec7323a6a5mr368454885a.55.1776708163272;\n Mon, 20 Apr 2026 11:02:43 -0700 (PDT)",
            "by 2002:a05:620a:454e:b0:8ec:7323:9361 with SMTP id\n af79cd13be357-8ec7323a6a5mr368450885a.55.1776708162737;\n Mon, 20 Apr 2026 11:02:42 -0700 (PDT)"
        ],
        "From": "Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>",
        "To": "gcc-patches@gcc.gnu.org",
        "Cc": "jeffrey.law@oss.qualcomm.com, andrew.pinski@oss.qualcomm.com,\n Daniel Barboza <daniel.barboza@oss.qualcomm.com>",
        "Subject": "[PATCH v3] match.pd: simplify lshift const cmp using bit_and\n [PR124019]",
        "Date": "Mon, 20 Apr 2026 15:02:38 -0300",
        "Message-ID": "<20260420180238.33599-1-daniel.barboza@oss.qualcomm.com>",
        "X-Mailer": "git-send-email 2.43.0",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-Proofpoint-ORIG-GUID": "lOtJ-jhSAbjJiJiDxOKOaZs7IjkLiNMQ",
        "X-Authority-Analysis": "v=2.4 cv=IMgyzAvG c=1 sm=1 tr=0 ts=69e66a45 cx=c_pps\n a=qKBjSQ1v91RyAK45QCPf5w==:117 a=etEqFfc6qwXwpI8uT8rzbw==:17\n a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22\n a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=mDV3o1hIAAAA:8\n a=EUspDBNiAAAA:8 a=SG_IhA4x6b_efDZzdKsA:9 a=NFOGd7dJGGMPyQGDc5-O:22",
        "X-Proofpoint-GUID": "lOtJ-jhSAbjJiJiDxOKOaZs7IjkLiNMQ",
        "X-Proofpoint-Spam-Details-Enc": "AW1haW4tMjYwNDIwMDE3NSBTYWx0ZWRfX1eFNlKC08uO+\n yKa+QITfzitU1qkUY5DRRKLObYy6vOA0IBMmhuruvuLpQOYwos8LywBvREyEW3sPfkkDeNZcLfE\n SIZJRpXFshxk9zManBmt//rBjABcN38DoCRy5t4lVcImZBe7gSg35UqJTIoXfi0hHaI43Ftddm7\n vvxbE/FQYpiFOSbTakPrDNVTIvIvEH5Fq5vT3cdTeJ1CgzBS0LD4McNBgXWJHpetX0YrY6OVMzI\n mwo7kNASPikPUTX5JtNdkGdgZLF/WbGsk1v+M/bIDHh1LVgf9b2d/CN3ZghoU/9sdSY7wLjK5HZ\n Wc9NYJrx3FwyziqhD/VcdjRmguWEEeb2gqKcS5s1g7yVnLm7os1Iy9GAkgMZCmhC/eJ0jA0iMbT\n DJdoKEdD0aR5shiWkWh3xmTZH+cR+6o4x3/aP8hHDSZe8HJ6TUtkL2w4fwctRPEFrtaLDB4WtIN\n ifqamyf4MjGtvYn4vdA==",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49\n definitions=2026-04-20_03,2026-04-20_02,2025-10-01_01",
        "X-Proofpoint-Spam-Details": "rule=outbound_notspam policy=outbound score=0\n spamscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0\n phishscore=0 adultscore=0 clxscore=1015 bulkscore=0 suspectscore=0\n malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc=\n route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2604070000\n definitions=main-2604200175",
        "X-BeenThere": "gcc-patches@gcc.gnu.org",
        "X-Mailman-Version": "2.1.30",
        "Precedence": "list",
        "List-Id": "Gcc-patches mailing list <gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<https://gcc.gnu.org/mailman/options/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe>",
        "List-Archive": "<https://gcc.gnu.org/pipermail/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-request@gcc.gnu.org?subject=help>",
        "List-Subscribe": "<https://gcc.gnu.org/mailman/listinfo/gcc-patches>,\n <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe>",
        "Errors-To": "gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"
    },
    "content": "From: Daniel Barboza <daniel.barboza@oss.qualcomm.com>\n\nGiven a comparison with the format\n\nA << CST1 EQ|NE CST2\n\nTurn it into:\n\nA & CSTmask EQ|NE CST2 >> CST1\n\nWhere 'CSTmask' is a bitmask that filters A bits that would be discarded\nduring the shift. The idea is that a bit_and is, on most common targets\nat least, more efficient than a lshift.\n\nBootstrapped and regression tested on x86, aarch64 and RISC-V.\n\n\tPR tree-optimization/124019\n\ngcc/ChangeLog:\n\n\t* match.pd (`A<<CST1 EQ|NE CST2 -> (A&CSTmask) EQ|NE (CST2>>CST1)`):\n\tNew pattern.\n\ngcc/testsuite/ChangeLog:\n\n\t* gcc.target/aarch64/cmp_shifted_reg_1.c: changed comparison\n\tto \">\" to dodge this optimization and keep generating the\n\texpected shift compare insn.\n\t* gcc.dg/tree-ssa/pr124019.c: New test.\n---\n\nChanges from v2:\n- Wrapped the pattern around #if GIMPLE;\n- Added check for lshift single_use();\n- negs.c changes were reverted.  The pattern is now checking\n  for lshift single_use() and the test is no longer being affected;\n- Removed the  \"A << 1 != CST1\" check related to pr114760-1.c and\n  the CLZ builtin. Checking for single_use() is enough to avoid\n  tripping on the builtin, thus we're free to support this use\n  case;\n- Added check for CST2 zero bits.\n- v2 link: https://gcc.gnu.org/pipermail/gcc-patches/2026-March/709651.html\n\n gcc/match.pd                                  | 36 +++++++++++++++++\n gcc/testsuite/gcc.dg/tree-ssa/pr124019.c      | 40 +++++++++++++++++++\n .../gcc.target/aarch64/cmp_shifted_reg_1.c    |  2 +-\n 3 files changed, 77 insertions(+), 1 deletion(-)\n create mode 100644 gcc/testsuite/gcc.dg/tree-ssa/pr124019.c",
    "diff": "diff --git a/gcc/match.pd b/gcc/match.pd\nindex 7b652afb43d..d34d3ddf35f 100644\n--- a/gcc/match.pd\n+++ b/gcc/match.pd\n@@ -1454,6 +1454,42 @@ DEFINE_INT_AND_FLOAT_ROUND_FN (RINT)\n   (if (TYPE_UNSIGNED (type))\n     (bit_and @0 (bit_not (lshift { build_all_ones_cst (type); } @1)))))\n \n+#if GIMPLE\n+/* PR124019: A << CST1 EQ|NE CST2 -> (A & CSTmask) EQ|NE (CST2 >> CST1);  */\n+(for cmp (eq ne)\n+ (simplify\n+  (cmp (lshift@3 @0 INTEGER_CST@1) INTEGER_CST@2)\n+   (if (INTEGRAL_TYPE_P (TREE_TYPE (@0))\n+\t&& single_use (@3)\n+\t&& tree_fits_uhwi_p (@1)\n+\t&& tree_to_uhwi (@1) < TYPE_PRECISION (TREE_TYPE (@0))\n+\t&& tree_to_uhwi (@1) < TYPE_PRECISION (TREE_TYPE (@2)))\n+    (with {\n+      unsigned prec2 = TYPE_PRECISION (TREE_TYPE (@2));\n+      wide_int cst2_mask = wi::mask (tree_to_uhwi (@1), false, prec2);\n+     }\n+     /* We need to assert that CST2 lower CST1 bits are zero for the\n+\ttransformation to be valid.  This seem to be already taken\n+\tcare of\tby CCP, turning cases like \"a << 4 == 17\" into\n+\t\"return 0\", and this check might be redundant.  We can't rely\n+\ton CCP always having our backs though, therefore validate the\n+\tzero bits here to be sure.  */\n+     (if (wi::to_wide (@2) == 0\n+\t  || wi::eq_p (wi::bit_and (cst2_mask, wi::to_wide (@2)),\n+\t\t       wi::zero (prec2)))\n+      (with {\n+\tunsigned prec = TYPE_PRECISION (TREE_TYPE (@0));\n+\tunsigned mask_len = prec - tree_to_uhwi (@1);\n+\ttree cst1_mask = wide_int_to_tree (TREE_TYPE (@0),\n+\t\t\t\t\t   wi::mask (mask_len, false, prec));\n+\ttree type3 = TREE_TYPE (@3);\n+\twide_int lrshift = wi::lrshift (wi::to_wide (@2), wi::to_wide (@1));\n+\ttree cst_lrshift = wide_int_to_tree (type3, lrshift);\n+      }\n+      (cmp (convert:type3 (bit_and @0 { cst1_mask; }))\n+\t   { cst_lrshift; })))))))\n+#endif\n+\n (for bitop (bit_and bit_ior)\n      cmp (eq ne)\n  /* PR35691: Transform\ndiff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr124019.c b/gcc/testsuite/gcc.dg/tree-ssa/pr124019.c\nnew file mode 100644\nindex 00000000000..bd46864c75b\n--- /dev/null\n+++ b/gcc/testsuite/gcc.dg/tree-ssa/pr124019.c\n@@ -0,0 +1,40 @@\n+/* { dg-additional-options -O2 } */\n+/* { dg-additional-options -fdump-tree-optimized } */\n+\n+typedef unsigned char uint8_t;\n+typedef signed char int8_t;\n+\n+uint8_t f1(int8_t a)\n+{\n+    int8_t b = a << 4;\n+    return b == -128;\n+}\n+\n+uint8_t f2(int8_t a)\n+{\n+    int8_t b = a << 4;\n+    return b != -128;\n+}\n+\n+uint8_t f3(int8_t a)\n+{\n+    int8_t b = a << 6;\n+    return b == -128;\n+}\n+\n+uint8_t f4(int8_t a)\n+{\n+    int8_t b = a << 7;\n+    return b == -128;\n+}\n+\n+uint8_t f5(int8_t a)\n+{\n+    int8_t b = a << 1;\n+    return b == -128;\n+}\n+/* { dg-final { scan-tree-dump-times \" & 15;\" 2 optimized } } */\n+/* { dg-final { scan-tree-dump-times \" & 3;\" 1 optimized } } */\n+/* { dg-final { scan-tree-dump-times \" & 1;\" 1 optimized } } */\n+/* { dg-final { scan-tree-dump-times \" & 127;\" 1 optimized } } */\n+/* { dg-final { scan-tree-dump-times \" << \" 0 optimized } } */\ndiff --git a/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c b/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c\nindex cacecf4e71d..8feedce5c51 100644\n--- a/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c\n+++ b/gcc/testsuite/gcc.target/aarch64/cmp_shifted_reg_1.c\n@@ -4,7 +4,7 @@\n int f3 (int x, int y)\n {\n   int res = x << 3;\n-  return res != 0;\n+  return res > 0;\n }\n \n /* We should combine the shift and compare */\n",
    "prefixes": [
        "v3"
    ]
}