get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 2228697,
    "url": "http://patchwork.ozlabs.org/api/1.1/patches/2228697/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/20260427081337.416B24BB24D9@sourceware.org/",
    "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": "<20260427081337.416B24BB24D9@sourceware.org>",
    "date": "2026-04-27T08:13:09",
    "name": "tree-optimization/125025 - ICE with niter analysis and UBSAN",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "e4d8d3ae6886f511a912279a358db5afe4ee71eb",
    "submitter": {
        "id": 4338,
        "url": "http://patchwork.ozlabs.org/api/1.1/people/4338/?format=api",
        "name": "Richard Biener",
        "email": "rguenther@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/20260427081337.416B24BB24D9@sourceware.org/mbox/",
    "series": [
        {
            "id": 501602,
            "url": "http://patchwork.ozlabs.org/api/1.1/series/501602/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501602",
            "date": "2026-04-27T08:13:09",
            "name": "tree-optimization/125025 - ICE with niter analysis and UBSAN",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/501602/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/2228697/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/2228697/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 (1024-bit key;\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=BgHIXP0/;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=puAJuHEi;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=BgHIXP0/;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=puAJuHEi;\n\tdkim-atps=neutral",
            "legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org\n (client-ip=2620:52:6:3111::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 (1024-bit key,\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=BgHIXP0/;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=puAJuHEi;\n\tdkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de\n header.a=rsa-sha256 header.s=susede2_rsa header.b=BgHIXP0/;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=puAJuHEi",
            "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=suse.de",
            "sourceware.org; spf=pass smtp.mailfrom=suse.de",
            "server2.sourceware.org;\n arc=none smtp.remote-ip=195.135.223.131",
            "smtp-out2.suse.de;\n\tnone"
        ],
        "Received": [
            "from vm01.sourceware.org (vm01.sourceware.org\n [IPv6:2620:52:6:3111::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 4g3xCl1n0Mz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 18:13:39 +1000 (AEST)",
            "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 416B24BB24D9\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 27 Apr 2026 08:13:37 +0000 (GMT)",
            "from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n by sourceware.org (Postfix) with ESMTPS id 87D4F4BB1C2D\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 08:13:10 +0000 (GMT)",
            "from murzim.nue2.suse.org (unknown [10.168.4.243])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest\n SHA256)\n (No client certificate requested)\n by smtp-out2.suse.de (Postfix) with ESMTPS id 86C335BCDE\n for <gcc-patches@gcc.gnu.org>; Mon, 27 Apr 2026 08:13:09 +0000 (UTC)"
        ],
        "DKIM-Filter": [
            "OpenDKIM Filter v2.11.0 sourceware.org 416B24BB24D9",
            "OpenDKIM Filter v2.11.0 sourceware.org 87D4F4BB1C2D"
        ],
        "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org 87D4F4BB1C2D",
        "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org 87D4F4BB1C2D",
        "ARC-Seal": "i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1777277590; cv=none;\n b=fZ2//vXu4u5ywYaZnrzw0IOOM0Sc1Oe26WIAqj6XlljycH0+ed5vaT5lX8i0XkcfPXHXV6aJ4T7FGsdGhhhCE/LqGLSLggvUFWy4B9fBHkjZ8ymhZHAp1LcoKfTYFqwTz07+5ndyiGlSEqkPnMHacX8AJBvB0Z1BKHr5Sk3GOtQ=",
        "ARC-Message-Signature": "i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777277590; c=relaxed/simple;\n bh=yiL8wEVulikb2gVyeGECeBSBoLmsoHHzpiZdVIsOh3Q=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:MIME-Version;\n b=EZLtTypOaZVbCeMgD6kyOphRAJaDZ0qVZCtfR9wvOMvQytnrUmeyGeeOdViaTCdW+h7cMeh8x4bdRNsZC7jru+GxuYKDpYXxFYb0WXBQzE/5nxPwr24ZO+0zheeXVGFNnIZD9pJDM42UVk9D+jkTd5eCUbdKeOtF3qlQKsdtZA0=",
        "ARC-Authentication-Results": "i=1; server2.sourceware.org",
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1777277589;\n h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version:\n content-type:content-type; bh=4wPtX5JUODSWiMSq+C3NdH47VXeWICIbo0mdl7ooESQ=;\n b=BgHIXP0/IMO727HXHrGsPz1kk2WzsIEhv7t32CBKQB04qZx6L//eF8BkXc/tPHQBh0+cbS\n 2Sk0vGhvIG+W9X9DBhzjui0daCj2FCZH1StEIX+co3opRamR3CyenliaJBRj4bHn4C5wea\n yE3h0Qg94/oCamkKxWRcdNWTDpeFZAQ=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1777277589;\n h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version:\n content-type:content-type; bh=4wPtX5JUODSWiMSq+C3NdH47VXeWICIbo0mdl7ooESQ=;\n b=puAJuHEi0ysB+928Ia4z0sKubzDeMbCAi42hLoN+PHo8KlWnlD1C160z4QHYQQTZRh28Vr\n B7slPNaOPM6Q/hDA==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1777277589;\n h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version:\n content-type:content-type; bh=4wPtX5JUODSWiMSq+C3NdH47VXeWICIbo0mdl7ooESQ=;\n b=BgHIXP0/IMO727HXHrGsPz1kk2WzsIEhv7t32CBKQB04qZx6L//eF8BkXc/tPHQBh0+cbS\n 2Sk0vGhvIG+W9X9DBhzjui0daCj2FCZH1StEIX+co3opRamR3CyenliaJBRj4bHn4C5wea\n yE3h0Qg94/oCamkKxWRcdNWTDpeFZAQ=",
            "v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1777277589;\n h=from:from:reply-to:date:date:to:to:cc:mime-version:mime-version:\n content-type:content-type; bh=4wPtX5JUODSWiMSq+C3NdH47VXeWICIbo0mdl7ooESQ=;\n b=puAJuHEi0ysB+928Ia4z0sKubzDeMbCAi42hLoN+PHo8KlWnlD1C160z4QHYQQTZRh28Vr\n B7slPNaOPM6Q/hDA=="
        ],
        "Date": "Mon, 27 Apr 2026 10:13:09 +0200 (CEST)",
        "From": "Richard Biener <rguenther@suse.de>",
        "To": "gcc-patches@gcc.gnu.org",
        "Subject": "[PATCH] tree-optimization/125025 - ICE with niter analysis and UBSAN",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=US-ASCII",
        "X-Spamd-Result": "default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n MISSING_MID(2.50)[]; NEURAL_HAM_LONG(-1.00)[-0.998];\n NEURAL_HAM_SHORT(-0.20)[-0.994]; MIME_GOOD(-0.10)[text/plain];\n TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1];\n MISSING_XM_UA(0.00)[]; FROM_EQ_ENVFROM(0.00)[];\n TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_ZERO(0.00)[0];\n FUZZY_RATELIMITED(0.00)[rspamd.com];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]",
        "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",
        "Message-Id": "<20260427081337.416B24BB24D9@sourceware.org>"
    },
    "content": "The following avoids trying to compute the absolute step by\nnegating a signed step, instead, as done in one other place\nalready, first convert to unsigned and then negate.\n\nBootstrapped and tested on x86_64-unknown-linux-gnu, pushed.\n\n\tPR tree-optimization/125025\n\t* tree-ssa-loop-niter.cc (number_of_iterations_ne): Avoid\n\tnegation of most negative signed integer.\n\t(number_of_iterations_lt): Likewise.\n\n\t* gcc.dg/torture/pr125025.c: New testcase.\n---\n gcc/testsuite/gcc.dg/torture/pr125025.c | 20 ++++++++++++++++++++\n gcc/tree-ssa-loop-niter.cc              |  8 ++++----\n 2 files changed, 24 insertions(+), 4 deletions(-)\n create mode 100644 gcc/testsuite/gcc.dg/torture/pr125025.c",
    "diff": "diff --git a/gcc/testsuite/gcc.dg/torture/pr125025.c b/gcc/testsuite/gcc.dg/torture/pr125025.c\nnew file mode 100644\nindex 00000000000..ba156bb69d4\n--- /dev/null\n+++ b/gcc/testsuite/gcc.dg/torture/pr125025.c\n@@ -0,0 +1,20 @@\n+/* { dg-do compile } */\n+/* { dg-additional-options \"-fsanitize=undefined\" } */\n+\n+void f2(signed char a0)\n+{\n+  signed char v4;\n+  _Bool c7;\n+  signed char v8 = 91;\n+  v4 = v8 + v8;\n+  v8 = 15 - 50;\n+  a0 = v8 * v4;\n+  v8 = v4 - a0;\n+lbl_br10:\n+  c7 = a0 <= 0;\n+  if (c7)\n+    return;\n+  v4 = v8 - 24;\n+  a0 = a0 + v4;\n+  goto lbl_br10;\n+}\ndiff --git a/gcc/tree-ssa-loop-niter.cc b/gcc/tree-ssa-loop-niter.cc\nindex 2b4c4ea3da4..00c4a9c81f8 100644\n--- a/gcc/tree-ssa-loop-niter.cc\n+++ b/gcc/tree-ssa-loop-niter.cc\n@@ -988,8 +988,8 @@ number_of_iterations_ne (class loop *loop, tree type, affine_iv *iv,\n      if BNDS->below in the result is nonnegative.  */\n   if (tree_int_cst_sign_bit (iv->step))\n     {\n-      s = fold_convert (niter_type,\n-\t\t\tfold_build1 (NEGATE_EXPR, type, iv->step));\n+      s = fold_build1 (NEGATE_EXPR, niter_type,\n+\t\t       fold_convert (niter_type, iv->step));\n       c = fold_build2 (MINUS_EXPR, niter_type,\n \t\t       fold_convert (niter_type, iv->base),\n \t\t       fold_convert (niter_type, final));\n@@ -1633,8 +1633,8 @@ number_of_iterations_lt (class loop *loop, tree type, affine_iv *iv0,\n   if (integer_nonzerop (iv0->step))\n     step = fold_convert (niter_type, iv0->step);\n   else\n-    step = fold_convert (niter_type,\n-\t\t\t fold_build1 (NEGATE_EXPR, type, iv1->step));\n+    step = fold_build1 (NEGATE_EXPR, niter_type,\n+\t\t\tfold_convert (niter_type, iv1->step));\n \n   /* If we can determine the final value of the control iv exactly, we can\n      transform the condition to != comparison.  In particular, this will be\n",
    "prefixes": []
}