get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 833332,
    "url": "http://patchwork.ozlabs.org/api/1.2/patches/833332/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/1509625835-22344-5-git-send-email-claziss@synopsys.com/",
    "project": {
        "id": 17,
        "url": "http://patchwork.ozlabs.org/api/1.2/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,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1509625835-22344-5-git-send-email-claziss@synopsys.com>",
    "list_archive_url": null,
    "date": "2017-11-02T12:30:33",
    "name": "[4/6,ARC] Rework delegitimate_address hook",
    "commit_ref": null,
    "pull_url": null,
    "state": "new",
    "archived": false,
    "hash": "575e1559dd6ffd6e06eb24ea8873868d482c54a7",
    "submitter": {
        "id": 67086,
        "url": "http://patchwork.ozlabs.org/api/1.2/people/67086/?format=api",
        "name": "Claudiu Zissulescu",
        "email": "Claudiu.Zissulescu@synopsys.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/1509625835-22344-5-git-send-email-claziss@synopsys.com/mbox/",
    "series": [
        {
            "id": 11495,
            "url": "http://patchwork.ozlabs.org/api/1.2/series/11495/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=11495",
            "date": "2017-11-02T12:30:29",
            "name": "New baremetal features and fixes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/11495/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/833332/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/833332/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<gcc-patches-return-465738-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": [
            "patchwork-incoming@bilbo.ozlabs.org",
            "mailing list gcc-patches@gcc.gnu.org"
        ],
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=gcc-patches-return-465738-incoming=patchwork.ozlabs.org@gcc.gnu.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (1024-bit key;\n\tunprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org\n\theader.b=\"QWTpZWYk\"; dkim-atps=neutral",
            "sourceware.org; auth=none"
        ],
        "Received": [
            "from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3ySPhR0PVSz9sBW\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  2 Nov 2017 23:36:06 +1100 (AEDT)",
            "(qmail 54806 invoked by alias); 2 Nov 2017 12:34:46 -0000",
            "(qmail 53547 invoked by uid 89); 2 Nov 2017 12:34:43 -0000",
            "from smtprelay.synopsys.com (HELO smtprelay.synopsys.com)\n\t(198.182.47.9) by sourceware.org\n\t(qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP;\n\tThu, 02 Nov 2017 12:34:40 +0000",
            "from mailhost.synopsys.com (mailhost3.synopsys.com\n\t[10.12.238.238])\tby smtprelay.synopsys.com (Postfix) with\n\tESMTP id 66BC724E2036; Thu,  2 Nov 2017 05:34:39 -0700 (PDT)",
            "from mailhost.synopsys.com (localhost [127.0.0.1])\tby\n\tmailhost.synopsys.com (Postfix) with ESMTP id 4EB56B1D;\n\tThu,  2 Nov 2017 05:34:39 -0700 (PDT)",
            "from US01WEHTC2.internal.synopsys.com\n\t(us01wehtc2-vip.internal.synopsys.com [10.12.239.238])\tby\n\tmailhost.synopsys.com (Postfix) with ESMTP id 43265B1A;\n\tThu,  2 Nov 2017 05:34:39 -0700 (PDT)",
            "from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by\n\tUS01WEHTC2.internal.synopsys.com (10.12.239.237) with\n\tMicrosoft SMTP Server (TLS) id 14.3.266.1;\n\tThu, 2 Nov 2017 05:34:31 -0700",
            "from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by\n\tIN01WEHTCB.internal.synopsys.com (10.144.199.105) with\n\tMicrosoft SMTP Server (TLS) id 14.3.266.1;\n\tThu, 2 Nov 2017 18:04:29 +0530",
            "from nl20droid1.internal.synopsys.com (10.100.24.228) by\n\tIN01WEHTCA.internal.synopsys.com (10.144.199.243) with\n\tMicrosoft SMTP Server (TLS) id 14.3.266.1;\n\tThu, 2 Nov 2017 18:04:28 +0530"
        ],
        "DomainKey-Signature": "a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-type; q=dns; s=default; b=p7dU1ZQSoESKaIIg\n\tDcnvWA+sqsaqEeUwv6jQsRGgzxBj4i1a9IBomhwScbl2F4xblzw4sdRS9aIrkJTj\n\tb84Z9S702e2KOhXLRCSncSa33m/obfKqg3DFiiMw9FYfh+nF1wSvuvOI6Yy0EKwa\n\tu5SuT0bmsN9mOsZSu0VoBanNrTc=",
        "DKIM-Signature": "v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id\n\t:list-unsubscribe:list-archive:list-post:list-help:sender:from\n\t:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-type; s=default; bh=3JeC0CFgOQ+CQmITvHC1uh\n\t024rY=; b=QWTpZWYkCB+2fB6KEfJTocYmUIPPD746q4CmqV/Afnvh1+OwE/rVhG\n\tlUp8bxBnk7c9SuEmmvf33zhZ0QXR6ocMveMK2NC+kzUu3fY4aptQaPl/sQVifi2J\n\tomEOSLbyVBJndoDg44++XE8L0gJoUbaS3boZGoYIB+rsDgwPw9Zu4=",
        "Mailing-List": "contact gcc-patches-help@gcc.gnu.org; run by ezmlm",
        "Precedence": "bulk",
        "List-Id": "<gcc-patches.gcc.gnu.org>",
        "List-Unsubscribe": "<mailto:gcc-patches-unsubscribe-incoming=patchwork.ozlabs.org@gcc.gnu.org>",
        "List-Archive": "<http://gcc.gnu.org/ml/gcc-patches/>",
        "List-Post": "<mailto:gcc-patches@gcc.gnu.org>",
        "List-Help": "<mailto:gcc-patches-help@gcc.gnu.org>",
        "Sender": "gcc-patches-owner@gcc.gnu.org",
        "X-Virus-Found": "No",
        "X-Spam-SWARE-Status": "No, score=-23.9 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tKAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_NONE,\n\tRP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=PLUS,\n\tH*RU:10.12.239.238, Hx-spam-relays-external:sk:US01WEH,\n\tHx-spam-relays-external:sk:us01weh",
        "X-HELO": "smtprelay.synopsys.com",
        "From": "Claudiu Zissulescu <Claudiu.Zissulescu@synopsys.com>",
        "To": "<gcc-patches@gcc.gnu.org>",
        "CC": "<Claudiu.Zissulescu@synopsys.com>, <Francois.Bedard@synopsys.com>,\n\t<andrew.burgess@embecosm.com>",
        "Subject": "[PATCH 4/6] [ARC] Rework delegitimate_address hook",
        "Date": "Thu, 2 Nov 2017 13:30:33 +0100",
        "Message-ID": "<1509625835-22344-5-git-send-email-claziss@synopsys.com>",
        "In-Reply-To": "<1509625835-22344-1-git-send-email-claziss@synopsys.com>",
        "References": "<1509625835-22344-1-git-send-email-claziss@synopsys.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain"
    },
    "content": "From: claziss <claziss@synopsys.com>\n\nDelegitimize address is used to undo the obfuscating effect of PIC\naddresses, returning the address in a way which is understood by the\ncompiler.\n\ngcc/\n2017-04-25  Claudiu Zissulescu  <claziss@synopsys.com>\n\n\t* config/arc/arc.c (arc_delegitimize_address_0): Refactored to\n\trecognize new pic like addresses.\n\t(arc_delegitimize_address): Clean up.\n\ntestsuite/\n2017-08-31  Claudiu Zissulescu  <claziss@synopsys.com>\n\n\t* testsuite/gcc.target/arc/tdelegitimize_addr.c: New test.\n---\n gcc/config/arc/arc.c                              | 91 ++++++++++-------------\n gcc/testsuite/gcc.target/arc/tdelegitimize_addr.c | 23 ++++++\n 2 files changed, 62 insertions(+), 52 deletions(-)\n create mode 100755 gcc/testsuite/gcc.target/arc/tdelegitimize_addr.c",
    "diff": "diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c\nindex e7194a2..07dd072 100644\n--- a/gcc/config/arc/arc.c\n+++ b/gcc/config/arc/arc.c\n@@ -9506,68 +9506,55 @@ arc_legitimize_address (rtx orig_x, rtx oldx, machine_mode mode)\n }\n \n static rtx\n-arc_delegitimize_address_0 (rtx x)\n+arc_delegitimize_address_0 (rtx op)\n {\n-  rtx u, gp, p;\n-\n-  if (GET_CODE (x) == CONST && GET_CODE (u = XEXP (x, 0)) == UNSPEC)\n+  switch (GET_CODE (op))\n     {\n-      if (XINT (u, 1) == ARC_UNSPEC_GOT\n-\t  || XINT (u, 1) == ARC_UNSPEC_GOTOFFPC)\n-\treturn XVECEXP (u, 0, 0);\n+    case CONST:\n+      return arc_delegitimize_address_0 (XEXP (op, 0));\n+\n+    case UNSPEC:\n+      switch (XINT (op, 1))\n+\t{\n+\tcase ARC_UNSPEC_GOT:\n+\tcase ARC_UNSPEC_GOTOFFPC:\n+\t  return XVECEXP (op, 0, 0);\n+\tdefault:\n+\t  break;\n+\t}\n+      break;\n+\n+    case PLUS:\n+      {\n+\trtx t1 = arc_delegitimize_address_0 (XEXP (op, 0));\n+\trtx t2 = XEXP (op, 1);\n+\n+\tif (t1 && t2)\n+\t  return gen_rtx_PLUS (GET_MODE (op), t1, t2);\n+\tbreak;\n+      }\n+\n+    default:\n+      break;\n     }\n-  else if (GET_CODE (x) == CONST && GET_CODE (p = XEXP (x, 0)) == PLUS\n-\t   && GET_CODE (u = XEXP (p, 0)) == UNSPEC\n-\t   && (XINT (u, 1) == ARC_UNSPEC_GOT\n-\t       || XINT (u, 1) == ARC_UNSPEC_GOTOFFPC))\n-    return gen_rtx_CONST\n-\t    (GET_MODE (x),\n-\t     gen_rtx_PLUS (GET_MODE (p), XVECEXP (u, 0, 0), XEXP (p, 1)));\n-  else if (GET_CODE (x) == PLUS\n-\t   && ((REG_P (gp = XEXP (x, 0))\n-\t\t&& REGNO (gp) == PIC_OFFSET_TABLE_REGNUM)\n-\t       || (GET_CODE (gp) == CONST\n-\t\t   && GET_CODE (u = XEXP (gp, 0)) == UNSPEC\n-\t\t   && XINT (u, 1) == ARC_UNSPEC_GOT\n-\t\t   && GET_CODE (XVECEXP (u, 0, 0)) == SYMBOL_REF\n-\t\t   && !strcmp (XSTR (XVECEXP (u, 0, 0), 0), \"_DYNAMIC\")))\n-\t   && GET_CODE (XEXP (x, 1)) == CONST\n-\t   && GET_CODE (u = XEXP (XEXP (x, 1), 0)) == UNSPEC\n-\t   && XINT (u, 1) == ARC_UNSPEC_GOTOFF)\n-    return XVECEXP (u, 0, 0);\n-  else if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 0)) == PLUS\n-\t   && ((REG_P (gp = XEXP (XEXP (x, 0), 1))\n-\t\t&& REGNO (gp) == PIC_OFFSET_TABLE_REGNUM)\n-\t       || (GET_CODE (gp) == CONST\n-\t\t   && GET_CODE (u = XEXP (gp, 0)) == UNSPEC\n-\t\t   && XINT (u, 1) == ARC_UNSPEC_GOT\n-\t\t   && GET_CODE (XVECEXP (u, 0, 0)) == SYMBOL_REF\n-\t\t   && !strcmp (XSTR (XVECEXP (u, 0, 0), 0), \"_DYNAMIC\")))\n-\t   && GET_CODE (XEXP (x, 1)) == CONST\n-\t   && GET_CODE (u = XEXP (XEXP (x, 1), 0)) == UNSPEC\n-\t   && XINT (u, 1) == ARC_UNSPEC_GOTOFF)\n-    return gen_rtx_PLUS (GET_MODE (x), XEXP (XEXP (x, 0), 0),\n-\t\t\t XVECEXP (u, 0, 0));\n-  else if (GET_CODE (x) == PLUS\n-\t   && (u = arc_delegitimize_address_0 (XEXP (x, 1))))\n-    return gen_rtx_PLUS (GET_MODE (x), XEXP (x, 0), u);\n   return NULL_RTX;\n }\n \n static rtx\n-arc_delegitimize_address (rtx x)\n+arc_delegitimize_address (rtx orig_x)\n {\n-  rtx orig_x = x = delegitimize_mem_from_attrs (x);\n-  if (GET_CODE (x) == MEM)\n+  rtx x = orig_x;\n+\n+  if (MEM_P (x))\n     x = XEXP (x, 0);\n+\n   x = arc_delegitimize_address_0 (x);\n-  if (x)\n-    {\n-      if (MEM_P (orig_x))\n-\tx = replace_equiv_address_nv (orig_x, x);\n-      return x;\n-    }\n-  return orig_x;\n+  if (!x)\n+    return orig_x;\n+\n+  if (MEM_P (orig_x))\n+    x = replace_equiv_address_nv (orig_x, x);\n+  return x;\n }\n \n /* Return a REG rtx for acc1.  N.B. the gcc-internal representation may\ndiff --git a/gcc/testsuite/gcc.target/arc/tdelegitimize_addr.c b/gcc/testsuite/gcc.target/arc/tdelegitimize_addr.c\nnew file mode 100755\nindex 0000000..0d010ff\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/arc/tdelegitimize_addr.c\n@@ -0,0 +1,23 @@\n+/* { dg-do compile } */\n+/* { dg-skip-if \"\" { ! { clmcpu } } } */\n+/* { dg-options \"-mcpu=archs -g -O1 -fpic -mlra\" } */\n+\n+/* Check if delegitimize address returns correctly the un-obfuscated\n+   address.  */\n+\n+typedef struct {\n+  long long tv_usec;\n+} t_a;\n+\n+static t_a a;\n+\n+int b;\n+extern void fn2 (t_a);\n+\n+void fn1 (void)\n+{\n+ again:\n+  fn2(a);\n+  if (b)\n+    goto again;\n+}\n",
    "prefixes": [
        "4/6",
        "ARC"
    ]
}