Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/1.1/patches/2229507/?format=api
{ "id": 2229507, "url": "http://patchwork.ozlabs.org/api/1.1/patches/2229507/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/patch/CAFULd4aYKy=bQkwxTPyHbrAxTgch7s7ohxN9=-tehmW4XbfFrA@mail.gmail.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": "<CAFULd4aYKy=bQkwxTPyHbrAxTgch7s7ohxN9=-tehmW4XbfFrA@mail.gmail.com>", "date": "2026-04-28T10:55:24", "name": "[pushed] i386: Avoid redundant classify_argument call in construct_container", "commit_ref": null, "pull_url": null, "state": "new", "archived": false, "hash": "7e9c52aa415f852cde6c60a59f1890da6e528ebe", "submitter": { "id": 808, "url": "http://patchwork.ozlabs.org/api/1.1/people/808/?format=api", "name": "Uros Bizjak", "email": "ubizjak@gmail.com" }, "delegate": null, "mbox": "http://patchwork.ozlabs.org/project/gcc/patch/CAFULd4aYKy=bQkwxTPyHbrAxTgch7s7ohxN9=-tehmW4XbfFrA@mail.gmail.com/mbox/", "series": [ { "id": 501822, "url": "http://patchwork.ozlabs.org/api/1.1/series/501822/?format=api", "web_url": "http://patchwork.ozlabs.org/project/gcc/list/?series=501822", "date": "2026-04-28T10:55:24", "name": "[pushed] i386: Avoid redundant classify_argument call in construct_container", "version": 1, "mbox": "http://patchwork.ozlabs.org/series/501822/mbox/" } ], "comments": "http://patchwork.ozlabs.org/api/patches/2229507/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/2229507/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=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=TOGRAhCV;\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 (2048-bit key,\n unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256\n header.s=20251104 header.b=TOGRAhCV", "sourceware.org;\n dmarc=pass (p=none dis=none) header.from=gmail.com", "sourceware.org; spf=pass smtp.mailfrom=gmail.com", "server2.sourceware.org;\n arc=pass smtp.remote-ip=209.85.208.172" ], "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 4g4cmr4LYMz1xvV\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 20:56:09 +1000 (AEST)", "from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 9C6B24BB593D\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 28 Apr 2026 10:56:07 +0000 (GMT)", "from mail-lj1-f172.google.com (mail-lj1-f172.google.com\n [209.85.208.172])\n by sourceware.org (Postfix) with ESMTPS id E107F4BB3BFE\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 10:55:39 +0000 (GMT)", "by mail-lj1-f172.google.com with SMTP id\n 38308e7fff4ca-386b553c70eso90971571fa.0\n for <gcc-patches@gcc.gnu.org>; Tue, 28 Apr 2026 03:55:39 -0700 (PDT)" ], "DKIM-Filter": [ "OpenDKIM Filter v2.11.0 sourceware.org 9C6B24BB593D", "OpenDKIM Filter v2.11.0 sourceware.org E107F4BB3BFE" ], "DMARC-Filter": "OpenDMARC Filter v1.4.2 sourceware.org E107F4BB3BFE", "ARC-Filter": "OpenARC Filter v1.0.0 sourceware.org E107F4BB3BFE", "ARC-Seal": [ "i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1777373740; cv=pass;\n b=eRTl1uoBGOLRRgyn7/9QGr2jrhyH1SrbkeqlwkpmmUt6mC/KFs4vIC6rCbt6fwQGHuW/B3Og5fT35tbbnbh3Fce6cZJMud5WR2muOVJaAJG3HlpPnQQPL5f0xS4HoRaz9FAj86AJJ0uI6F4TkfUkH8fDRNBi/vPQQJlP3Jx/3p4=", "i=1; a=rsa-sha256; t=1777373738; cv=none;\n d=google.com; s=arc-20240605;\n b=YYGB/O0sUsW7ruPBgZCSVN67zqBqNhuUu/pL8gmuNl9XcA4nlndPom3UaIE3o+z8QP\n jvxqXSuYq3SMhwn02X2X5qMD2OMNY0yWrVtzpfAe6klr6+TeF5ikInzis2Z/qzCIhldY\n Bix7+hv9bYqh7cMvJNaS47RHlXM6oBuH0OkyuQhSjsun7ErV9Zztb7qhTSCwCWf6SLk/\n ppqL9uUFH5HLCoPLxECCZaslYg7jmd+bLr/lOSL8TSChTW/dwiBsuw3ABs+EoWFFf3Zm\n VT7OICnLuWBHoFuswGwNhO4jg0s2PhQCVfC3F/HbrMmEII/YGChbv4ln7AaJ3glCph40\n 905g==" ], "ARC-Message-Signature": [ "i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1777373740; c=relaxed/simple;\n bh=8SE6+sZw6AzeZcJaPDm//ysmrf1d3njInxO7JbfjWMk=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=i/ScRQftjZVUAY/RbkQfihP4XD/EgZ/2F8TmSRtg3qE7c4wyULWi1/FBEkMKwOu5AEVMSBwfFmPgVkxJa/a5/BQxwsTvIp6kYxanQ6u//BzFWBIr8OMZ/lUeXBLf8+ipz7qFOZSTxMrx20XbkJnmg0vl1XjJo66MkfRXdtiQ05g=", "i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=to:subject:message-id:date:from:mime-version:dkim-signature;\n bh=5o+fVB83F0jw6LrnPz4eKiuQ8HYWQSNQophaTXzA934=;\n fh=XNn3asQvIblazGK92GBt13dVv+YmGV3pBS0JC29ZQco=;\n b=KNdcb96hKi5Pz/+e8SW1pAbzXB5AKskiEMZqMB6O0n20iQXXGPLVf94BxV44156kDB\n +A+qQi7+jXk4UrQWSfz6UTCP2SR1BZp+JKTsxoqem/LLQL+DFQvtDTFh8x2w6wtzVd5F\n FYWHQ324Tf6IlLWwBxm/A/ZY+SYTKPyVV9e0qOXOseajmtyyIYBMvzZlCj+kx2pKA6aw\n a6Z8EXKUU2innMm6t352uqhgwDoDKyO0L4TXWRB8TmfDmkT8hHtukQbdZQq9jr8SoTiX\n W0BytDCriymSqVTXDy90PH0KBzuEs1IsS//T6XVG/AOOA4FU7FXsVd6se9S9xIkotnyO\n 0Jgw==; darn=gcc.gnu.org" ], "ARC-Authentication-Results": [ "i=2; server2.sourceware.org", "i=1; mx.google.com; arc=none" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=gmail.com; s=20251104; t=1777373738; x=1777978538; darn=gcc.gnu.org;\n h=to:subject:message-id:date:from:mime-version:from:to:cc:subject\n :date:message-id:reply-to;\n bh=5o+fVB83F0jw6LrnPz4eKiuQ8HYWQSNQophaTXzA934=;\n b=TOGRAhCVVIakpoRjLCIwX7GzRnGgiLeIJDLiFgMFMpLaW+wBv6KeqB/mmJWC6TGiNi\n 9n17CQY+VxneDM7UghU5R2rT1elFZ7BVu+nKDb4ey12VYmjP7D+Z4M8BppwO8CaUdNT8\n SOhjt9fV9MLHHIhbYV/8O2+IZw1o5F4b8pgumugGGrCOA+aFaRll2KQ4Pp1Xn4uqM3Q+\n QNT/pmGrTQdCPg09bBDKiP8g2OV6efq4uGhhvObWvCpmGgA4aXjDC/pBytmD/Z2+jMHU\n o6ENcFAkUKvmuqL1mVV/DC5lEatKMOXwyiqMmcPMRV4fuaRvCa6EomlFR1s/gFfDR4Kb\n BVwQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1777373738; x=1777978538;\n h=to:subject:message-id:date:from:mime-version:x-gm-gg\n :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;\n bh=5o+fVB83F0jw6LrnPz4eKiuQ8HYWQSNQophaTXzA934=;\n b=O/8fN1Gu1zN6TQuiIuX6V1MZwVwIl4xU0l6ROEHubGqmV20upWXKtupyZZXrgb3xq0\n avglffqdXBj0W/24eGPNbYOYJTTMM4ggD2Pqh1axRZu5a+fJybhjbP6FY26rGNVrmDgx\n a48S+mHCMqEpkcUV2l0lugjiCfHp5IAAGPe05l7DNHLNFQbZCYYrORpxJOCJc54YtsMn\n JuKTJq3+91myKFl4GB7vPuQIIGMF7Nb4BqSZvSbHUNytwOGnFNN5rDb3s3Dq1sbxxyi3\n 7XevDtnPAPrz5/I+JVg5eWqasgtBhS6XbE3QRcd+Op14iBXsObvQsmHnCABqGaS+GAlt\n edNg==", "X-Gm-Message-State": "AOJu0YxFDg2SEP7mJjPNU5pX4m6NIgtihMCQOjfNiO1iDr3SppAQt5D2\n jRpv/wXqvPORC72cIcBzm1fYzbgvTgKKQl9fiJZKfBng4woneV3MTVjJ5OfqYs3gt9qM8nbXbRG\n 5GRE0IzfsiI8MfPaCcxaJCFynVbnfDGggOVZo1dE=", "X-Gm-Gg": "AeBDietGStFt4lS9Zq0jbyxEuWd53CMS0Di+zUY8z+0PK9jRw1n7+G1GT54Q9849QYN\n u8T82dNKilvtNrUl8xaM4egUTBnHImD71oXUA+F/BU4bdc6VKGgAMH6KwLTJ1SKO7VRPeaF1gIn\n cikBT4/c6RIhFSYMKuY4ZeiwuDIy5BiLAnQY+agTgCfEvg34pVcCaJNbNBG+nUR1PgLysEuxpib\n xzeGlDGcutbVCgNcNBWM7P8SKShUd1re7JchCdigmv7BwX+wN729VfrdZp3AZMcLcSNFXy+ZGAZ\n wMmLrQYlnzrWNYEZZmDVLNE3J2Hta+E4w4H5OHVMehrngfSWkRF0HFrehjGWy+C76cscoWRCjZw\n asCm/zGMEAhVvydiOmhGJja5C9VK18xJEAvLHHLBJ5+qutQ==", "X-Received": "by 2002:a05:651c:b27:b0:38e:973a:a635 with SMTP id\n 38308e7fff4ca-39240fd3fb9mr7732801fa.30.1777373737511; Tue, 28 Apr 2026\n 03:55:37 -0700 (PDT)", "MIME-Version": "1.0", "From": "Uros Bizjak <ubizjak@gmail.com>", "Date": "Tue, 28 Apr 2026 12:55:24 +0200", "X-Gm-Features": "AVHnY4IJHqsaU9nF3YnmYArT4P2kVid97EDkcD7Sf7LbxSTIhDXybpKBKLhri5Y", "Message-ID": "\n <CAFULd4aYKy=bQkwxTPyHbrAxTgch7s7ohxN9=-tehmW4XbfFrA@mail.gmail.com>", "Subject": "[pushed] i386: Avoid redundant classify_argument call in\n construct_container", "To": "\"gcc-patches@gcc.gnu.org\" <gcc-patches@gcc.gnu.org>", "Content-Type": "multipart/mixed; boundary=\"00000000000042114b0650831286\"", "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": "In construct_container, remove the early call to classify_argument.\nexamine_argument function already invokes classify_argument internally\nand returns early if the argument must be passed in memory, making the\ninitial call in construct_container redundant. Recompute the\nclassification only when needed and assert that it succeeds.\n\nWhile there, change the type of the in_return parameter from int to\nbool in examine_argument and construct_container, and adjust all call\nsites accordingly.\n\nNo functional change intended.\n\ngcc/\n * config/i386/i386.cc (construct_container): Remove redundant\n early call to classify_argument. Recompute the classification\n only when needed and assert that it succeeds.\n (examine_argument): Change in_return parameter type to bool.\n (function_arg_advance_64): Update call to examine_argument.\n (function_arg_64): Update call to construct_container.\n (function_value_64): Likewise.\n (ix86_return_in_memory): Update call to examine_argument.\n (ix86_gimplify_va_arg): Update calls to construct_container\n and examine_argument.\n\nBootstrapped and regression tested on x86_64-linux-gnu {,-m32}.\n\nUros.", "diff": "diff --git a/gcc/config/i386/i386.cc b/gcc/config/i386/i386.cc\nindex cb37318ed24..4558b6198fc 100644\n--- a/gcc/config/i386/i386.cc\n+++ b/gcc/config/i386/i386.cc\n@@ -2745,7 +2745,7 @@ classify_argument (machine_mode mode, const_tree type,\n class. Return true iff parameter should be passed in memory. */\n \n static bool\n-examine_argument (machine_mode mode, const_tree type, int in_return,\n+examine_argument (machine_mode mode, const_tree type, bool in_return,\n \t\t int *int_nregs, int *sse_nregs)\n {\n enum x86_64_reg_class regclass[MAX_CLASSES];\n@@ -2790,8 +2790,8 @@ examine_argument (machine_mode mode, const_tree type, int in_return,\n \n static rtx\n construct_container (machine_mode mode, machine_mode orig_mode,\n-\t\t const_tree type, int in_return, int nintregs, int nsseregs,\n-\t\t const int *intreg, int sse_regno)\n+\t\t const_tree type, bool in_return, int nintregs,\n+\t\t int nsseregs, const int *intreg, int sse_regno)\n {\n /* The following variables hold the static issued_error state. */\n static bool issued_sse_arg_error;\n@@ -2809,12 +2809,10 @@ construct_container (machine_mode mode, machine_mode orig_mode,\n rtx exp[MAX_CLASSES];\n rtx ret;\n \n- n = classify_argument (mode, type, regclass, 0);\n- if (!n)\n- return NULL;\n if (examine_argument (mode, type, in_return, &needed_intregs,\n \t\t\t&needed_sseregs))\n return NULL;\n+\n if (needed_intregs > nintregs || needed_sseregs > nsseregs)\n return NULL;\n \n@@ -2849,6 +2847,9 @@ construct_container (machine_mode mode, machine_mode orig_mode,\n return NULL;\n }\n \n+ n = classify_argument (mode, type, regclass, 0);\n+ gcc_assert (n);\n+\n /* Likewise, error if the ABI requires us to return values in the\n x87 registers and the user specified -mno-80387. */\n if (!TARGET_FLOAT_RETURNS_IN_80387 && in_return)\n@@ -3211,7 +3212,7 @@ function_arg_advance_64 (CUMULATIVE_ARGS *cum, machine_mode mode,\n \t\t || VALID_AVX256_REG_MODE (mode)))\n return 0;\n \n- if (!examine_argument (mode, type, 0, &int_nregs, &sse_nregs)\n+ if (!examine_argument (mode, type, false, &int_nregs, &sse_nregs)\n && sse_nregs <= cum->sse_nregs && int_nregs <= cum->nregs)\n {\n cum->nregs -= int_nregs;\n@@ -3491,8 +3492,8 @@ function_arg_64 (const CUMULATIVE_ARGS *cum, machine_mode mode,\n else\n parm_regs = x86_64_int_parameter_registers;\n \n- return construct_container (mode, orig_mode, type, 0, cum->nregs,\n-\t\t\t cum->sse_nregs,\n+ return construct_container (mode, orig_mode, type, false,\n+\t\t\t cum->nregs, cum->sse_nregs,\n \t\t\t &parm_regs[cum->regno],\n \t\t\t cum->sse_regno);\n }\n@@ -4308,7 +4309,7 @@ function_value_64 (machine_mode orig_mode, machine_mode mode,\n mode = word_mode;\n }\n \n- ret = construct_container (mode, orig_mode, valtype, 1,\n+ ret = construct_container (mode, orig_mode, valtype, true,\n \t\t\t X86_64_REGPARM_MAX, X86_64_SSE_REGPARM_MAX,\n \t\t\t x86_64_int_return_registers, 0);\n \n@@ -4475,7 +4476,7 @@ ix86_return_in_memory (const_tree type, const_tree fntype ATTRIBUTE_UNUSED)\n \t{\n \t int needed_intregs, needed_sseregs;\n \n-\t return examine_argument (mode, type, 1,\n+\t return examine_argument (mode, type, true,\n \t\t\t\t &needed_intregs, &needed_sseregs);\n \t}\n }\n@@ -5005,9 +5006,8 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,\n \n default:\n container = construct_container (nat_mode, TYPE_MODE (type),\n-\t\t\t\t type, 0, X86_64_REGPARM_MAX,\n-\t\t\t\t X86_64_SSE_REGPARM_MAX, intreg,\n-\t\t\t\t 0);\n+\t\t\t\t type, false, X86_64_REGPARM_MAX,\n+\t\t\t\t X86_64_SSE_REGPARM_MAX, intreg, 0);\n break;\n }\n \n@@ -5025,7 +5025,8 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,\n lab_false = create_artificial_label (UNKNOWN_LOCATION);\n lab_over = create_artificial_label (UNKNOWN_LOCATION);\n \n- examine_argument (nat_mode, type, 0, &needed_intregs, &needed_sseregs);\n+ examine_argument (nat_mode, type, false,\n+\t\t\t&needed_intregs, &needed_sseregs);\n \n bool container_in_reg = false;\n if (REG_P (container))\n", "prefixes": [ "pushed" ] }