[{"id":3677138,"web_url":"http://patchwork.ozlabs.org/comment/3677138/","msgid":"<ad4j2-5y0WGBZ9LI@tucnak>","list_archive_url":null,"date":"2026-04-14T11:24:11","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/people/671/","name":"Jakub Jelinek","email":"jakub@redhat.com"},"content":"On Tue, Apr 14, 2026 at 01:16:01PM +0200, Richard Biener wrote:\n> The following corrects how we apply PROMOTE_PROTOTYPES during RTL\n> expansion.  The unsignedp field in args info is supposed to\n> denote the signedness of the unpromoted value, but we've set it\n> to the signedness of integer_type_node.  So delay adjusting the\n> type until after we compute signedness of the formal argument.\n> \n> Bootstrapped and tested on x86_64-unknown-linux-gnu.\n> \n> There's two variants, the inline one affects transparent union\n> passing, promoting a smaller than int first element, while the\n> attached one does not.  This was originally changed for GCC16\n> with r16-169-g78db4753c9646a and r16-170-ga670ebde399548.\n> \n> Overall this restores behavior to that of GCC 15 before we\n> moved PROMOTE_PROTOTYPES application from frontends to RTL\n> expansion.  GCC 15 did not apply promotion to the transparent\n> union case.\n> \n> OK for trunk?  Which variant?\n> \n> Thanks,\n> Richard.\n> \n> \tPR middle-end/124877\n> \t* calls.cc (initialize_argument_information): Compute\n> \tsignedness of the formal argument type before applying\n> \tPROMOTE_PROTOTYPES promotion.\n> \n> \t* gcc.target/i386/pr124877.c: New testcase.\n\nMy preference is the first patch, but please wait for Jeff and H.J.'s\nopinion.\n\n\tJakub","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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Gv4YyRcP;\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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=Gv4YyRcP","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"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 4fw24H6T5Rz1y2d\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 21:24:46 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id A638E4BA2E09\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 11:24:44 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id F403D4BA2E07\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 11:24:18 +0000 (GMT)","from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-418-gokWjCBbPFaOxYJ_DkkcMg-1; Tue,\n 14 Apr 2026 07:24:17 -0400","from mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.12])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id D4DC31800365; Tue, 14 Apr 2026 11:24:15 +0000 (UTC)","from tucnak.zalov.cz (unknown [10.44.33.129])\n by mx-prod-int-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id 44EC019560AB; Tue, 14 Apr 2026 11:24:15 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63EBOCq52953794\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Tue, 14 Apr 2026 13:24:12 +0200","(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63EBOBAh2953793;\n Tue, 14 Apr 2026 13:24:11 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org A638E4BA2E09","OpenDKIM Filter v2.11.0 sourceware.org F403D4BA2E07"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org F403D4BA2E07","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org F403D4BA2E07","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776165859; cv=none;\n b=JxDdMownOwaX5PSugqXdDvTDl9FX2NifuEISlFuigy+8j2IVsVsOI5y46OV9PCrHwTdDhXKnIATpHQmI4KJ6j/txadR+GIOFF1Kx8YZj44q7m8c3uyR4RMBHhqMp7taQcNuwmd5zCz+IhpuYw8JVRp/qIwIUope4qJm1oqKJiD4=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776165859; c=relaxed/simple;\n bh=mACD5cSdlJiBUPvtQP6CcTu2WUvbtI/iyOze6p4VoZ8=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=UfpLTZBPAb98X4Eo59g8YrZGCB5uNeAqGfMCN+Jb0cVwGKbAG1o8Vj/uf69z47OGCbY/YmVhMN9r1m+dRPP4ZQx5wCHakssSOAGh7HgS3I/Y4r5fvR3S5CR9DyZyah1MZa1OTbHYVP+hPP7DwQ74F2r3iKF/sHHdjvnoxizHEGQ=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776165858;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:in-reply-to:in-reply-to:  references:references;\n bh=TXIEMEnmbVc4LREUQlTHRqzu/G1dabsY1yMFlgn4wC0=;\n b=Gv4YyRcPRAv3iLcPEb3W/MW4iWc9Ps2SDhW91iNKHg85iLjz6YcsTKBp3RElES1vkQNw1D\n 1Av8C0WDlZ9mUDlY05LIGgY6L6vxH1gXvX1RKEN/2FV62aNxaWWR4Z6hgZRe1wcEQJXpNM\n n5F03qZ4s+c/a6ZU+Fm3EWNkB9qP0Qs=","X-MC-Unique":"gokWjCBbPFaOxYJ_DkkcMg-1","X-Mimecast-MFC-AGG-ID":"gokWjCBbPFaOxYJ_DkkcMg_1776165856","Date":"Tue, 14 Apr 2026 13:24:11 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Richard Biener <rguenther@suse.de>","Cc":"gcc-patches@gcc.gnu.org, jeffrey.law@oss.qualcomm.com, hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","Message-ID":"<ad4j2-5y0WGBZ9LI@tucnak>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>","MIME-Version":"1.0","In-Reply-To":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>","X-Scanned-By":"MIMEDefang 3.0 on 10.30.177.12","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"LoKJpL27QGksXMq13emTQdP8wM8r-5TOqYl5ejwB7MY_1776165856","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","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>","Reply-To":"Jakub Jelinek <jakub@redhat.com>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3677170,"web_url":"http://patchwork.ozlabs.org/comment/3677170/","msgid":"<CAMe9rOoCAeL1oE-Z5izgJxjA0Or63UEyVefaHReKhQ8dK1a_xw@mail.gmail.com>","list_archive_url":null,"date":"2026-04-14T12:43:02","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","submitter":{"id":4387,"url":"http://patchwork.ozlabs.org/api/people/4387/","name":"H.J. Lu","email":"hjl.tools@gmail.com"},"content":"On Tue, Apr 14, 2026 at 7:24 PM Jakub Jelinek <jakub@redhat.com> wrote:\n>\n> On Tue, Apr 14, 2026 at 01:16:01PM +0200, Richard Biener wrote:\n> > The following corrects how we apply PROMOTE_PROTOTYPES during RTL\n> > expansion.  The unsignedp field in args info is supposed to\n> > denote the signedness of the unpromoted value, but we've set it\n> > to the signedness of integer_type_node.  So delay adjusting the\n> > type until after we compute signedness of the formal argument.\n> >\n> > Bootstrapped and tested on x86_64-unknown-linux-gnu.\n> >\n> > There's two variants, the inline one affects transparent union\n> > passing, promoting a smaller than int first element, while the\n> > attached one does not.  This was originally changed for GCC16\n> > with r16-169-g78db4753c9646a and r16-170-ga670ebde399548.\n> >\n> > Overall this restores behavior to that of GCC 15 before we\n> > moved PROMOTE_PROTOTYPES application from frontends to RTL\n> > expansion.  GCC 15 did not apply promotion to the transparent\n> > union case.\n> >\n> > OK for trunk?  Which variant?\n> >\n> > Thanks,\n> > Richard.\n> >\n> >       PR middle-end/124877\n> >       * calls.cc (initialize_argument_information): Compute\n> >       signedness of the formal argument type before applying\n> >       PROMOTE_PROTOTYPES promotion.\n> >\n> >       * gcc.target/i386/pr124877.c: New testcase.\n>\n> My preference is the first patch, but please wait for Jeff and H.J.'s\n> opinion.\n>\n>         Jakub\n>\n\nEither one works for me.\n\nThanks.","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=MazNrkyy;\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=MazNrkyy","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.210.178"],"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 4fw3qx3wxJz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 22:44:13 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 7FC7A4BA23CC\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 12:44:11 +0000 (GMT)","from mail-pf1-f178.google.com (mail-pf1-f178.google.com\n [209.85.210.178])\n by sourceware.org (Postfix) with ESMTPS id 1914C4BA23E9\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 12:43:40 +0000 (GMT)","by mail-pf1-f178.google.com with SMTP id\n d2e1a72fcca58-8296d553142so2865551b3a.3\n for <gcc-patches@gcc.gnu.org>; Tue, 14 Apr 2026 05:43:40 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 7FC7A4BA23CC","OpenDKIM Filter v2.11.0 sourceware.org 1914C4BA23E9"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 1914C4BA23E9","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 1914C4BA23E9","ARC-Seal":["i=2; a=rsa-sha256; d=sourceware.org; s=key; t=1776170625; cv=pass;\n b=GGXg0+tQCtvJIcJHAaAMdwez9Lv1Tl/ksv/eJpSwHmQjmEcLaSDIFTyTaICgpBWpG9PmO8x1HnxNeJUzS/sNYhzlkRyxu0/yHpZ1BJsN3h01cZoQFLYd9ydMu4wEIXTu4f5QktwR81F6kcl85PO6GA6pYHOpWYA0dEMtkI6WT5I=","i=1; a=rsa-sha256; t=1776170619; cv=none;\n d=google.com; s=arc-20240605;\n b=Zx9NcNGV3ohEvFt7Qvdk0BtINj0O1rWDm0VaD4oHKsQ8/SNccE7ip9YFAm3hVLF6KW\n qL5Afvh2uFhgGc4pORO/94sFrJiegqKxdz80P2eEcyOzvzFJg8iH8yXwBi/ZTdVxYxzO\n MACDiC98g0yFsXMLp1g5CAjzTM/OoLGuBqFMXXa1xi90w9QhD5rIJVir3HOddFg4e5m0\n JEzGVfx5rCG49lu3ZlUAq7CLBswH3UW/LE+Pf3+oVJD1X65rzrHof85Tw6GmCU6CabZd\n WoDTF8i4hiIs9daJbV/v+dzku8O6dkj/YZllr+mE8WEO3XdB/Mt0uTbLbFGMfcrUSTyo\n CQVg=="],"ARC-Message-Signature":["i=2; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776170625; c=relaxed/simple;\n bh=jxnl4MIng9TED7jbkIP1xfQYpH71ZX3tV9n1uwX4oMY=;\n h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To;\n b=pvTXtUuYxsFBtJMIoN4Uh6AKgKZqHl5QAPpH8bJOcQlhT8ucYI4D4VqIBpe0sdTXI9BMideXmAq9icCyjYLidbiMOIvP6rCQZ4QPkKbVbM8HcBfAdfVZ41rikko3YJ4n8Uy5wdvKOtpNKLZNZcB3sCHXL/f5GK0hGyGKzuLwR+k=","i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com;\n s=arc-20240605;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:dkim-signature;\n bh=94fme/f09fEYgjfWwzaVNT0kA+ieEBfOca7Ei2kUhmo=;\n fh=fAc+mdDrKN7tLFTePBCg1WATu/PMlhksAJmvETKy+Xo=;\n b=Rna3HD5mJcRP3BzdUBc+Pv6ECIiPcGV5qsg3vllapK5VGlgQanMwO1PRLjNag7qiYf\n M1Qs4D7596OWyNKh/n95FvXJbgZO5Vcgs4LPpderVbD42b3ymzxZ0GRjPaBftKzh2TaF\n d45zsIX6k+oJEXSsTEpMcJai4zU1XVcARq4H4Pw2fks5nDQV2YC/KrRdyH8EUCF1hLmt\n 9/hryOQ3MgP6rfasMarFJ/gAp107CCL5LmjuuyMZEIsz+AiHridihOzCAnz6RQksKLGA\n gAr5lB6vyxKCTNQqJ7/xbdOgbNcJGQtn48LJQdNj5JcO+mrHooXNz49DZZ7eIA0m5U95\n 5Lsg==; 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=1776170619; x=1776775419; darn=gcc.gnu.org;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:from:to:cc:subject:date\n :message-id:reply-to;\n bh=94fme/f09fEYgjfWwzaVNT0kA+ieEBfOca7Ei2kUhmo=;\n b=MazNrkyyJCczfv9jsscxoAA1RNyua3+fC+doJHJ4kkfqKKks7V9M3LJbAbJjyd3lwn\n ulNPHLy85Bki/G+ieTLAK7v47bQM5KAA3TyMHiowSJV64TsZkFG0CZtRYjhVaI9RlQx6\n /4nS82NcHmuZXPnhtHqyoLG2w9axSoXhgILvnkzP42JMe+/4OVU2X6lvgwU/J5OhQLpj\n dz1H77rDF0RY2wLOUNz2vxQZzHY2SvJcdxZoPazdLqZvHEi0fYT6Lj6va/CnJdmlEtoK\n czWmGh3y/+bTHWig4XOFNSXVmy7FckGE3CehFnT+UQn076N4hRu4vyp26pXO5qk3/Ax/\n Ve4g==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776170619; x=1776775419;\n h=content-transfer-encoding:cc:to:subject:message-id:date:from\n :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from\n :to:cc:subject:date:message-id:reply-to;\n bh=94fme/f09fEYgjfWwzaVNT0kA+ieEBfOca7Ei2kUhmo=;\n b=MxLbjHDa+SIEGQA5R9zElFcXOy1voKMzXOKibZ7ylVG6jpftcKpZWXD8f/RbEHOqY3\n DyhJZCpArQHFoChL24dqmbzQLGXNl4/8CE1pjpZ+7ZswX9EkZFp/WWBULjYUbNotC5qD\n U0Vi+TZP1cVsMEJ00x170GiNWn4ZpmYQoMaIZJd40KyN4BNYSgO4plMIj30um9WOMSv+\n S2t6buudjghapxCNuHaqeXbNYkxULvBjwagiCMfCwUStPgv+cbBib/wTfHo0zixVxr8q\n MwTaMZbjkD5lB2aZC++KI6rOnnU9WlGoXeJgwO+SDbRL5WMynywiBHDI0eIxX5qc7777\n L7vw==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9D07aEGK054585o0A/4CJbo3YIcOaaKa6+5keJWrrw5jFjVdqzG2fK5pHX9bmGryDpeve2YX/tb7Rkkw==@gcc.gnu.org","X-Gm-Message-State":"AOJu0Yyzo9bncddloMuRtbf+T2W+PnXAOXfD+GEv86PIUqVWkcL2GQ4R\n y8YBnwoPtD2WlkO1uUr53/AVrMcwDrGAWmjZgAA/94M7Zi/QL2D52TBF8hGm9YUmFt3BpJDYIRl\n SwbxkngJ/y9BtDkO2H8tXVRGDu5cRzcU=","X-Gm-Gg":"AeBDiev6l1/JwD9q7nvdiWiB6ToKM3LWPukpNBeEsSfVvuokIyw0HaG0NrpbRM724mn\n czw62WRuBwmEcKmtW/0ktL/exbqdBhfT62CWg6/SjVFmIM0rQo9K2X7IH9yuw/M0tvaPuD5Ee2j\n qkKwaIxcCDqG4rqxvYO3s1TPwY5G+llUl0aS00s+oIKugXVCpFrNlc7NL9EpveQQ1FCKKwe2xYK\n 16CtFmvbn+s8jAtKh5BWhkG3NMGe1hgqtfLdpqsHw7lDsKORDg46Q4Sx9FVHScb7HtQ9GstobWO\n WzQjHQ==","X-Received":"by 2002:a05:6a00:3918:b0:82c:ded1:261f with SMTP id\n d2e1a72fcca58-82f0c29912fmr18433271b3a.27.1776170618784; Tue, 14 Apr 2026\n 05:43:38 -0700 (PDT)","MIME-Version":"1.0","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <ad4j2-5y0WGBZ9LI@tucnak>","In-Reply-To":"<ad4j2-5y0WGBZ9LI@tucnak>","From":"\"H.J. Lu\" <hjl.tools@gmail.com>","Date":"Tue, 14 Apr 2026 20:43:02 +0800","X-Gm-Features":"AQROBzAihsu77f1s_za5AOrMk8OFFr3PV37b0zz9RDX_AtrNa22aLSSRtSnCo40","Message-ID":"\n <CAMe9rOoCAeL1oE-Z5izgJxjA0Or63UEyVefaHReKhQ8dK1a_xw@mail.gmail.com>","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","To":"Jakub Jelinek <jakub@redhat.com>","Cc":"Richard Biener <rguenther@suse.de>, gcc-patches@gcc.gnu.org,\n jeffrey.law@oss.qualcomm.com","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","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"}},{"id":3677791,"web_url":"http://patchwork.ozlabs.org/comment/3677791/","msgid":"<24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>","list_archive_url":null,"date":"2026-04-15T19:06:48","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","submitter":{"id":92310,"url":"http://patchwork.ozlabs.org/api/people/92310/","name":"Jeffrey Law","email":"jeffrey.law@oss.qualcomm.com"},"content":"On 4/14/2026 5:16 AM, Richard Biener wrote:\n> The following corrects how we apply PROMOTE_PROTOTYPES during RTL\n> expansion.  The unsignedp field in args info is supposed to\n> denote the signedness of the unpromoted value, but we've set it\n> to the signedness of integer_type_node.  So delay adjusting the\n> type until after we compute signedness of the formal argument.\n>\n> Bootstrapped and tested on x86_64-unknown-linux-gnu.\n>\n> There's two variants, the inline one affects transparent union\n> passing, promoting a smaller than int first element, while the\n> attached one does not.  This was originally changed for GCC16\n> with r16-169-g78db4753c9646a and r16-170-ga670ebde399548.\n>\n> Overall this restores behavior to that of GCC 15 before we\n> moved PROMOTE_PROTOTYPES application from frontends to RTL\n> expansion.  GCC 15 did not apply promotion to the transparent\n> union case.\n>\n> OK for trunk?  Which variant?\n>\n> Thanks,\n> Richard.\n>\n> \tPR middle-end/124877\n> \t* calls.cc (initialize_argument_information): Compute\n> \tsignedness of the formal argument type before applying\n> \tPROMOTE_PROTOTYPES promotion.\n>\n> \t* gcc.target/i386/pr124877.c: New testcase.\nI'd lean somewhat towards the attached variant (not affecting \ntransparent unions), but that's just to minimize the possibility of \nunexpected changes.   If we wanted to go with the transparent union \nvariant, a testcase for that seems appropriate.\n\nOK for the attached variant.  Also OK for the inline variant if a \ntestcase for transparent union handling is included.\n\njeff","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=eOFUEm5O;\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=bdm0WTVe;\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=eOFUEm5O;\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=bdm0WTVe","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.180.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 4fwrHb5rmkz1yHc\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 05:07:22 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 49CD54BA2E14\n\tfor <incoming@patchwork.ozlabs.org>; Wed, 15 Apr 2026 19:07:20 +0000 (GMT)","from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com\n [205.220.180.131])\n by sourceware.org (Postfix) with ESMTPS id 9C9DC4BA2E0A\n for <gcc-patches@gcc.gnu.org>; Wed, 15 Apr 2026 19:06:52 +0000 (GMT)","from pps.filterd (m0279868.ppops.net [127.0.0.1])\n by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id\n 63FFQDuP1702344\n for <gcc-patches@gcc.gnu.org>; Wed, 15 Apr 2026 19:06:52 GMT","from mail-dy1-f199.google.com (mail-dy1-f199.google.com\n [74.125.82.199])\n by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4djdamgrx1-1\n (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT)\n for <gcc-patches@gcc.gnu.org>; Wed, 15 Apr 2026 19:06:51 +0000 (GMT)","by mail-dy1-f199.google.com with SMTP id\n 5a478bee46e88-2c0f6593ef5so9831398eec.1\n for <gcc-patches@gcc.gnu.org>; Wed, 15 Apr 2026 12:06:51 -0700 (PDT)","from [172.31.0.11] ([136.38.201.137])\n by smtp.gmail.com with ESMTPSA id\n a92af1059eb24-12c5f3f3d93sm2362600c88.15.2026.04.15.12.06.49\n (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);\n Wed, 15 Apr 2026 12:06:49 -0700 (PDT)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 49CD54BA2E14","OpenDKIM Filter v2.11.0 sourceware.org 9C9DC4BA2E0A"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 9C9DC4BA2E0A","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 9C9DC4BA2E0A","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776280012; cv=none;\n b=xkP4nW3k+K9BaoeYKu2oKn8xI4O7Girzp/bs9KpSA0lXuMDO59Eb94QNfCODtakEmG4eqDzDGvBabkqosgbo60S25AjBiNnz2DTpZmuPc8Afu2RTR0QseC0XwlhngiUdQ0SVJGDzluTUMtCJCgZu48Z0ayTqWt/WKTMXAXdLSuI=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776280012; c=relaxed/simple;\n bh=epn8niwB4y5VqetkiYZQce7gRFQ1R176iqVfAyk11DQ=;\n h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version:\n Subject:To:From;\n b=rHNb7Aa06xIZOYbidVPqwOtDyiLrt66G/cJ3693aHBJYpopV3DNcJ9xl9HtJlBtAd5eSfp5C8uUGu5nsXMaOGlvQXpSnDxzMTZBPIiPk/hJ2n5xahrj8pkoOozUqM5Wk52/kva8cJ2D7PZeJT2PqKNYDYGwg9nfAMPeXnY4a9iY=","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:content-type:date:from:in-reply-to\n :message-id:mime-version:references:subject:to; s=qcppdkim1; bh=\n u06nfDbkskoO2GgXtdZnUSdijq0AmKJzo6DFuPBTqMc=; b=eOFUEm5OrFvtb49a\n uqWbwFy/i69spwsIpSjfN2gRxCdCwfVGjL7XL0jNb01+tMKMyv41xM3UK2NsklzR\n PeMn205TZcNnBPzWaTuBxnerLJrt2biKhoodumLvsNRehTphEsCY35kEV9LaQPfO\n ez1lmdvfj9gpULUHubYlmMxLlSc1hy+DFmRob1qas62JDka3yR99LqvVmV0YS6ku\n m6FQX1vG6eRO0GJfMULJ2eS254W8N12p3k8ux9nFj6CUudjprsdxToCo2N1crrr8\n rnwX1AfCPxRpjgRTMU2NCi061FMLomsdm6lgfmwDmIlZaoW0IKhTKQyzssFFSNQ+\n 9pt88g==","v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=oss.qualcomm.com; s=google; t=1776280011; x=1776884811; darn=gcc.gnu.org;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :from:to:cc:subject:date:message-id:reply-to;\n bh=u06nfDbkskoO2GgXtdZnUSdijq0AmKJzo6DFuPBTqMc=;\n b=bdm0WTVeL64PXQNADnbOPHboKUb0OtGYZHUlgzFve0WYjKokjtRbWfqEedvWzI3yIe\n C/PlZcB/RRmSQOyyQbfR09Cav2phaV3qtLU/RhjdFyQJSCMGceUYTToGL6oSsfKxNHQv\n xmkmcw6dne+/RaiHhhc1hBxjytcFVMi2VTZYqPUyDUIVu0B0Xdk5O1R90G4+nMPivs9V\n u7H4oOz5qFI6puNCy2/n9lk3PoQwgE2GN6PZwMVsyThERFWdXTL7WAiobE1UrOO5ALlz\n n9B/zsjnqAcCQ/yKARUsrOGAD/H9w8ZIg90raqNLFV2Jb7jywaN1K70tYT9tVuEsfNCe\n WXTA=="],"X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20251104; t=1776280011; x=1776884811;\n h=content-transfer-encoding:in-reply-to:from:content-language\n :references:cc:to:subject:user-agent:mime-version:date:message-id\n :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id\n :reply-to;\n bh=u06nfDbkskoO2GgXtdZnUSdijq0AmKJzo6DFuPBTqMc=;\n b=ASQ72jFRRfP/sobT7q4S+q6GY779fPQMuPJpdeSHnhExIiBUTnpA9WwYWahbWigVut\n FG4rqJGSlcHmAufL5aCaldC75oKheVsTXi3oWni4kfRLddRyRh6B7Gb0frBhwyRlfwe7\n KF25MeFiSHM6yY3MHli+NqWcu2lJ9FWgaM8XrNsu1QNY2amxbfZs24T0QonoTRqDqOTY\n te/EEvVOrf7uWxj0nGKjGnJ5cXOKpymH+yY0obq++a60zbKaOXPGaBay2kplr28+e78C\n yWuyB5h2HXtFQT/QRVhUbbHkBS3+LdqEBCR9Vm4wFVfSKknH8w/07tR4CxveQHzL9U1u\n NYAw==","X-Forwarded-Encrypted":"i=1;\n AFNElJ9zG+qPDyAZw1XXc8Sr4MKSnXS+/bfzB8/WAMqACuwLKaYmuHDuyN4EBkDLf0ijuRxNV05KhRs6JDZAZQ==@gcc.gnu.org","X-Gm-Message-State":"AOJu0YybfYWKcb0yjBwADwru7kQJs5/mmVwZ/Kv7YpftXuloXd8C1M+S\n mg2i5Ym3x841MWbK5h3hgbsTXB87s+uBYigOMXzTky0SOHQ5z9h9XUuq78DGRuLNqNWEiWd/xBN\n T8W1/wli4ux/PJ+LtWt5cNdGo/J+dwtDaV6PsBYgl11Qk/pwHQB1wDLvjjX+Z","X-Gm-Gg":"AeBDiesh5nTt3kbuUX+c0bsDf3yIER3Mn0Ynom2Db035o4JFZM/aJI0+yzeEb/B/QSg\n +32t1/wARWehLWI5pKLMTA/N5fX5wb5p0655Ayc0sl8sOkKbLOnC2E7dNJfQrxq/scOad6uo2Xa\n WPSRhDMNELFn4Uh2/hZM/WcG6DP/bM6kDhlnbZKCVqqEOdWkIBFg8qSBzoqmvhALhrtpcr+jUYB\n yniRGjnfWRbDqq76RCxKQGWc4TTsQUuJDCbw7aRA1bnneh36LMIBY7GKb4e47HvdXwHzpxeaE7f\n qwBwGsAM31xMEFsZTMWz5Y76tOBtEd8vzETZFwgmGBd7V+5ZKAaSI6qzgz9EDFH/lvDlEtnXZhI\n yUbJnztjZTY0DxVefmkpGlYcYTCUMmc5k0gzxFoaa8n5JtiHUU4a1BLTJPWhz","X-Received":["by 2002:a05:7022:4399:b0:128:d17b:e7ab with SMTP id\n a92af1059eb24-12c34f08350mr12589330c88.36.1776280010704;\n Wed, 15 Apr 2026 12:06:50 -0700 (PDT)","by 2002:a05:7022:4399:b0:128:d17b:e7ab with SMTP id\n a92af1059eb24-12c34f08350mr12589305c88.36.1776280010099;\n Wed, 15 Apr 2026 12:06:50 -0700 (PDT)"],"Message-ID":"<24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>","Date":"Wed, 15 Apr 2026 13:06:48 -0600","MIME-Version":"1.0","User-Agent":"Mozilla Thunderbird","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","To":"Richard Biener <rguenther@suse.de>, gcc-patches@gcc.gnu.org","Cc":"Jakub Jelinek <jakub@redhat.com>, hjl.tools@gmail.com","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>","Content-Language":"en-US","From":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>","In-Reply-To":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>","Content-Type":"text/plain; charset=UTF-8; format=flowed","Content-Transfer-Encoding":"8bit","X-Proofpoint-ORIG-GUID":"qp-Rwfb0QSI8awHs4y1Vhj0AfoN99Y-y","X-Authority-Analysis":"v=2.4 cv=HMjz0Itv c=1 sm=1 tr=0 ts=69dfe1cb cx=c_pps\n a=cFYjgdjTJScbgFmBucgdfQ==:117 a=asGLMfRmzhnGNxaIYohjRg==:17\n a=IkcTkHD0fZMA:10 a=A5OVakUREuEA:10 a=s4-Qcg_JpJYA:10\n a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22\n a=iFZ1RD2EaF0qLhxTxGgA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10\n a=scEy_gLbYbu1JhEsrz4S:22","X-Proofpoint-GUID":"qp-Rwfb0QSI8awHs4y1Vhj0AfoN99Y-y","X-Proofpoint-Spam-Details-Enc":"AW1haW4tMjYwNDE1MDE3OCBTYWx0ZWRfXwsHP2YoMBJet\n GbYVNSGlg3aBVgVQw8PLQCktnlyXlILY8bKgGk6Cug9v4EfJrKTULCN9I/mg9x8VRsCJfIdZ370\n JYV0tInBvCeLNjXdqMea6YtEGXkkcRut7294l40sx074/FWuvYNbaXyy9IS9bTRLcESKCNVP4Hf\n 7ESTtD2s1DpF/KbvHfcfgetxjyBP7oM3nYbwYy8mfprAhTCaHDvVXfR4QJA0uoIWjYTSVvngI0Q\n WbZWjlcQjDBwn+NbyqN6jftHORsGEx0Tq8w0fn6X6tLJQhmMxeVHpGgNBDa3IkRg7pP5+zWz282\n LpTyK3UpE2cchmrcizCjy1yf30yr4xcGCY2zqKLgpcBt2c7k2yNMAFC0cafFiZXMEbG8njDyWLs\n sn327kbF/Ri1ZxzjQ9el31GtlOqvO9mFtHqV4hqi/ijgBfpXjlxPCzuqvuTlo0QxBR9+BzQutLS\n 319HuTR64Opl5u/cfgQ==","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-15_01,2026-04-13_04,2025-10-01_01","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n adultscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 priorityscore=1501\n clxscore=1015 impostorscore=0 spamscore=0 malwarescore=0 suspectscore=0\n classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0\n reason=mlx scancount=1 engine=8.22.0-2604070000 definitions=main-2604150178","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"}},{"id":3677957,"web_url":"http://patchwork.ozlabs.org/comment/3677957/","msgid":"<pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr>","list_archive_url":null,"date":"2026-04-16T06:52:22","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","submitter":{"id":4338,"url":"http://patchwork.ozlabs.org/api/people/4338/","name":"Richard Biener","email":"rguenther@suse.de"},"content":"On Wed, 15 Apr 2026, Jeffrey Law wrote:\n\n> \n> \n> On 4/14/2026 5:16 AM, Richard Biener wrote:\n> > The following corrects how we apply PROMOTE_PROTOTYPES during RTL\n> > expansion.  The unsignedp field in args info is supposed to\n> > denote the signedness of the unpromoted value, but we've set it\n> > to the signedness of integer_type_node.  So delay adjusting the\n> > type until after we compute signedness of the formal argument.\n> >\n> > Bootstrapped and tested on x86_64-unknown-linux-gnu.\n> >\n> > There's two variants, the inline one affects transparent union\n> > passing, promoting a smaller than int first element, while the\n> > attached one does not.  This was originally changed for GCC16\n> > with r16-169-g78db4753c9646a and r16-170-ga670ebde399548.\n> >\n> > Overall this restores behavior to that of GCC 15 before we\n> > moved PROMOTE_PROTOTYPES application from frontends to RTL\n> > expansion.  GCC 15 did not apply promotion to the transparent\n> > union case.\n> >\n> > OK for trunk?  Which variant?\n> >\n> > Thanks,\n> > Richard.\n> >\n> >  PR middle-end/124877\n> >  * calls.cc (initialize_argument_information): Compute\n> >  signedness of the formal argument type before applying\n> >  PROMOTE_PROTOTYPES promotion.\n> >\n> >  * gcc.target/i386/pr124877.c: New testcase.\n> I'd lean somewhat towards the attached variant (not affecting transparent\n> unions), but that's just to minimize the possibility of unexpected changes. \n>  If we wanted to go with the transparent union variant, a testcase for that\n> seems appropriate.\n> \n> OK for the attached variant.  Also OK for the inline variant if a testcase for\n> transparent union handling is included.\n\nSo I'm going with the inline variant with a testcase, see below for the\nupdated patch.  The transparent union testcase is\n\ntypedef union { unsigned char x; signed char y; }\n__attribute__((__transparent_union__)) T;\nvoid bar(int, T x);\nvoid foo(signed char x)\n{\n  bar(0, x);\n}\n\nwhere the difference is\n\n-       movl    %edi, %esi\n+       movzbl  %dil, %esi\n        movl    $0, %edi\n        call    bar\n\nI agree with Jakub that it makes sense to do this.  I have amended\nthe documentation of the target hook accordingly.\n\nI'll apply later unless I hear otherwise.\n\nThanks,\nRichard.\n\nFrom b9f3dc13e5a8d89811b7afbe04ae3046e046f96a Mon Sep 17 00:00:00 2001\nFrom: Richard Biener <rguenther@suse.de>\nDate: Tue, 14 Apr 2026 13:16:01 +0200\nSubject: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES\nTo: gcc-patches@gcc.gnu.org\n\nThe following corrects how we apply PROMOTE_PROTOTYPES during RTL\nexpansion.  The unsignedp field in args info is supposed to\ndenote the signedness of the unpromoted value, but we've set it\nto the signedness of integer_type_node.  So delay adjusting the\ntype until after we compute signedness of the formal argument.\nThis was originally changed for GCC16 with r16-169-g78db4753c9646a\nand r16-170-ga670ebde399548.\n\nThe patch makes PROMOTE_PROTOTYPES newly affect transparent union\npassing, promoting a smaller than int first element, which we\ndid not in GCC 15.  gcc.target/i386/pr124877-2.c has a testcase\nshowing the effect nicely.\n\nOverall this restores behavior to that of GCC 15 before we\nmoved PROMOTE_PROTOTYPES application from frontends to RTL\nexpansion, but GCC 15 did not apply promotion to the transparent\nunion case.\n\n\tPR middle-end/124877\n\t* calls.cc (initialize_argument_information): Compute\n\tsignedness of the formal argument type before applying\n\tPROMOTE_PROTOTYPES promotion.  Also apply promotion to\n\ta smaller than int integer first member type of a\n\ttransparent union.\n\t* target.def (promote_prototypes): Update documentation.\n\t* doc/tm.texi: Re-generate.\n\n\t* gcc.target/i386/pr124877-1.c: New testcase.\n\t* gcc.target/i386/pr124877-2.c: Likewise.\n---\n gcc/calls.cc                               |  9 +++++----\n gcc/doc/tm.texi                            |  3 ++-\n gcc/target.def                             |  3 ++-\n gcc/testsuite/gcc.target/i386/pr124877-1.c | 11 +++++++++++\n gcc/testsuite/gcc.target/i386/pr124877-2.c | 14 ++++++++++++++\n 5 files changed, 34 insertions(+), 6 deletions(-)\n create mode 100644 gcc/testsuite/gcc.target/i386/pr124877-1.c\n create mode 100644 gcc/testsuite/gcc.target/i386/pr124877-2.c\n\ndiff --git a/gcc/calls.cc b/gcc/calls.cc\nindex 337e01065c2..4cdc2361a4b 100644\n--- a/gcc/calls.cc\n+++ b/gcc/calls.cc\n@@ -1396,10 +1396,6 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,\n       /* Replace erroneous argument with constant zero.  */\n       if (type == error_mark_node || !COMPLETE_TYPE_P (type))\n \targs[i].tree_value = integer_zero_node, type = integer_type_node;\n-      else if (promote_p\n-\t       && INTEGRAL_TYPE_P (type)\n-\t       && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))\n-\ttype = integer_type_node;\n \n       /* If TYPE is a transparent union or record, pass things the way\n \t we would pass the first field of the union or record.  We have\n@@ -1541,6 +1537,11 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,\n \t}\n \n       unsignedp = TYPE_UNSIGNED (type);\n+      if (promote_p\n+\t  && INTEGRAL_TYPE_P (type)\n+\t  && TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node))\n+\ttype = integer_type_node;\n+\n       arg.type = type;\n       arg.mode\n \t= promote_function_mode (type, TYPE_MODE (type), &unsignedp,\ndiff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi\nindex 394a46fdbaa..5edddd7f36e 100644\n--- a/gcc/doc/tm.texi\n+++ b/gcc/doc/tm.texi\n@@ -4078,7 +4078,8 @@ control passing certain arguments in registers.\n @deftypefn {Target Hook} bool TARGET_PROMOTE_PROTOTYPES (const_tree @var{fntype})\n This target hook returns @code{true} if an argument declared in a\n prototype as an integral type smaller than @code{int} should actually be\n-passed as an @code{int}.  In addition to avoiding errors in certain\n+passed as an @code{int}.  This also applies to the type of the first member\n++in a transparent union argument.  In addition to avoiding errors in certain\n cases of mismatch, it also makes for better code on certain machines.\n The default is to not promote prototypes.\n @end deftypefn\ndiff --git a/gcc/target.def b/gcc/target.def\nindex 206c94f8749..a9fcce7850f 100644\n--- a/gcc/target.def\n+++ b/gcc/target.def\n@@ -4910,7 +4910,8 @@ DEFHOOK\n (promote_prototypes,\n  \"This target hook returns @code{true} if an argument declared in a\\n\\\n prototype as an integral type smaller than @code{int} should actually be\\n\\\n-passed as an @code{int}.  In addition to avoiding errors in certain\\n\\\n+passed as an @code{int}.  This also applies to the type of the first member\\n\\\n++in a transparent union argument.  In addition to avoiding errors in certain\\n\\\n cases of mismatch, it also makes for better code on certain machines.\\n\\\n The default is to not promote prototypes.\",\n  bool, (const_tree fntype),\ndiff --git a/gcc/testsuite/gcc.target/i386/pr124877-1.c b/gcc/testsuite/gcc.target/i386/pr124877-1.c\nnew file mode 100644\nindex 00000000000..0be0b08d9e8\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/i386/pr124877-1.c\n@@ -0,0 +1,11 @@\n+/* { dg-do compile } */\n+\n+void bar(unsigned char x);\n+void foo()\n+{\n+  bar(225);\n+}\n+\n+/* PROMOTE_PROTOTYPES should make us pass 225, not -31, both would\n+   be valid according to the ABI.  */\n+/* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$225, %edi\" { target { ! ia32 } } } } */\ndiff --git a/gcc/testsuite/gcc.target/i386/pr124877-2.c b/gcc/testsuite/gcc.target/i386/pr124877-2.c\nnew file mode 100644\nindex 00000000000..f7410f49467\n--- /dev/null\n+++ b/gcc/testsuite/gcc.target/i386/pr124877-2.c\n@@ -0,0 +1,14 @@\n+/* { dg-do compile } */\n+/* { dg-options \"-O\" } */\n+\n+typedef union { unsigned char x; signed char y; }\n+__attribute__((__transparent_union__)) T;\n+void bar(int, T x);\n+void foo(signed char x)\n+{\n+  bar(0, x);\n+}\n+\n+/* PROMOTE_PROTOTYPES should make us pass x as int, but zero extended\n+   according to the type of the first union member.  */\n+/* { dg-final { scan-assembler \"movzbl\" } } */","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=Qqdx+9V6;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=n27xUgeY;\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=Qqdx+9V6;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=n27xUgeY;\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=Qqdx+9V6;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=n27xUgeY;\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=Qqdx+9V6;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=n27xUgeY","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.130","smtp-out1.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 4fx7xr1KZvz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 16:53:00 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 761584BA2E3C\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 06:52:52 +0000 (GMT)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n by sourceware.org (Postfix) with ESMTPS id B20224BA2E05\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 06:52:23 +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-out1.suse.de (Postfix) with ESMTPS id 50A6E6A7EC;\n Thu, 16 Apr 2026 06:52:22 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 761584BA2E3C","OpenDKIM Filter v2.11.0 sourceware.org B20224BA2E05"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org B20224BA2E05","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org B20224BA2E05","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776322344; cv=none;\n b=fc9B0KivhtXdtxNEouMXnIsDPIO0WyuFjYHNyuKMyzxMcwm3n6yjCwcAoMf9LaeNGvfWA4hCv4voQf0PutWY8eKqSwopANE8cRrHR0vDbiiHaHFhBgDYkyE/dGgfSSSCU/qi4AXPgrLdwnXjXf1orqeaheLW421cqp/JwAlVGbk=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776322344; c=relaxed/simple;\n bh=/NYS6BPMXxUB50HmTfKG4YtbzxwWRlWn/s+fgQcB6TA=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:Message-ID:MIME-Version;\n b=vZ2vpaquW+hoQ9JOIIJx4Cmv8/qrJ+rzE1+e9YTcgXotgPmTPk7VgSYiESQNnZQLXp0WoF2qDGwzDhv2ehAWupc9XVQsZKr+rgS9nW0sOPOjz2toaHBZ7V0EsLd9QUKsoQbOT/uZZvsDBbGuk53PAIDdR9TnNs0U6IkwqDDqgrE=","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=1776322342;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ka4QPku4tzdGTkaYHdPGobd4cq4aYe0RUttgtpoQ5W4=;\n b=Qqdx+9V6vjWRqhw4UvRKtD7VY1D638FWU5i1alCdlyLZrNLBkdEXiLu/iMSGu2crr0fbHS\n rSTeuDklfhPd5hqWEy+lvu8Kzgob/ksey/4DmHwphwVwmZpGCHabwfvtiP43kTbYtF7EA3\n jI/LSaxfZ4IYwtXEMQ0ASrUkY1F9t70=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776322342;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ka4QPku4tzdGTkaYHdPGobd4cq4aYe0RUttgtpoQ5W4=;\n b=n27xUgeY4Ts3ZGogh04LQZzKUhwVf/vYF0mfEgqEPjC0RB3/LFFvHjTzhCjgav92oV9ydY\n t9P4EwOZnWcwf2DA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776322342;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ka4QPku4tzdGTkaYHdPGobd4cq4aYe0RUttgtpoQ5W4=;\n b=Qqdx+9V6vjWRqhw4UvRKtD7VY1D638FWU5i1alCdlyLZrNLBkdEXiLu/iMSGu2crr0fbHS\n rSTeuDklfhPd5hqWEy+lvu8Kzgob/ksey/4DmHwphwVwmZpGCHabwfvtiP43kTbYtF7EA3\n jI/LSaxfZ4IYwtXEMQ0ASrUkY1F9t70=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776322342;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ka4QPku4tzdGTkaYHdPGobd4cq4aYe0RUttgtpoQ5W4=;\n b=n27xUgeY4Ts3ZGogh04LQZzKUhwVf/vYF0mfEgqEPjC0RB3/LFFvHjTzhCjgav92oV9ydY\n t9P4EwOZnWcwf2DA=="],"Date":"Thu, 16 Apr 2026 08:52:22 +0200 (CEST)","From":"Richard Biener <rguenther@suse.de>","To":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>","cc":"gcc-patches@gcc.gnu.org, Jakub Jelinek <jakub@redhat.com>,\n hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","In-Reply-To":"<24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>","Message-ID":"<pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>","MIME-Version":"1.0","Content-Type":"multipart/mixed;\n boundary=\"-1475677436-542418995-1776322342=:28865\"","X-Spamd-Result":"default: False [-1.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n CTYPE_MIXED_BOGUS(1.00)[]; NEURAL_HAM_SHORT(-0.20)[-1.000];\n MIME_GOOD(-0.10)[multipart/mixed,text/plain];\n TO_MATCH_ENVRCPT_ALL(0.00)[];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n MIME_TRACE(0.00)[0:+,1:+]; FREEMAIL_ENVRCPT(0.00)[gmail.com];\n RCPT_COUNT_THREE(0.00)[4]; TO_DN_SOME(0.00)[];\n FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[];\n FREEMAIL_CC(0.00)[gcc.gnu.org,redhat.com,gmail.com];\n RCVD_COUNT_ZERO(0.00)[0]; MISSING_XM_UA(0.00)[];\n TAGGED_RCPT(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]","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"}},{"id":3677976,"web_url":"http://patchwork.ozlabs.org/comment/3677976/","msgid":"<aeCTHaB-S0GP_7C1@tucnak>","list_archive_url":null,"date":"2026-04-16T07:43:25","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/people/671/","name":"Jakub Jelinek","email":"jakub@redhat.com"},"content":"On Thu, Apr 16, 2026 at 08:52:22AM +0200, Richard Biener wrote:\n> So I'm going with the inline variant with a testcase, see below for the\n> updated patch.  The transparent union testcase is\n> \n> typedef union { unsigned char x; signed char y; }\n> __attribute__((__transparent_union__)) T;\n> void bar(int, T x);\n> void foo(signed char x)\n> {\n>   bar(0, x);\n> }\n> \n> where the difference is\n> \n> -       movl    %edi, %esi\n> +       movzbl  %dil, %esi\n>         movl    $0, %edi\n>         call    bar\n> \n> I agree with Jakub that it makes sense to do this.  I have amended\n> the documentation of the target hook accordingly.\n> \n> I'll apply later unless I hear otherwise.\n\nWhat about also\ntypedef union { unsigned char x; signed char y; }\n__attribute__((__transparent_union__)) T;\nvoid bar(int, T x);\nvoid foo()\n{\n  bar(0, (T) { 42 });\n  bar(1, (T) { -42 });\n}\ntestcase?\nBoth gcc 15 and gcc 16 without your patch use\n        movl    $42, %esi\nand\n        movl    $-42, %esi\nI wonder if the latter shouldn't be $214 with your patch\nbecause it should be passed as the first transparent union\nmember (which is unsigned char here).\n\n\tJakub","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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=GZm89vic;\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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=GZm89vic","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.133.124"],"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 4fx94j12Hqz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 17:44:03 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 0C9584BA2E28\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 07:44:02 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by sourceware.org (Postfix) with ESMTP id 07EA34BA543C\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 07:43:34 +0000 (GMT)","from mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-Fqabwh5dMKOuLpy2AjKGkA-1; Thu,\n 16 Apr 2026 03:43:31 -0400","from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 7BFBE19560A3; Thu, 16 Apr 2026 07:43:29 +0000 (UTC)","from tucnak.zalov.cz (unknown [10.44.33.129])\n by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id E58001800446; Thu, 16 Apr 2026 07:43:28 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63G7hQmP887846\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Thu, 16 Apr 2026 09:43:26 +0200","(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63G7hPqG887845;\n Thu, 16 Apr 2026 09:43:25 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 0C9584BA2E28","OpenDKIM Filter v2.11.0 sourceware.org 07EA34BA543C"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 07EA34BA543C","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 07EA34BA543C","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776325415; cv=none;\n b=qUi8Grpgkuk8T2zBuPwz3Q51s4Z3DHIJIwtd28cu52vOChHqAD36mjYE/VnTtzGxP+yOW1OmgIy61CH1okTX6l0U44BmV/a6Ow3EowvHjp81/ZE4mYaB5+R9F7lF6OyZ0pgkto9cFQTNOOvSqfEYmMVZSJFfmx4MOYrrv5Dwgt8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776325415; c=relaxed/simple;\n bh=CoG4sx9/vjcrj7sg7cCLmKeC/84GZ6FF+qt7h26EM+0=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=LWbaQAIEvrdMMP/IJofWQJYnaxyC/GT5VW5m0dPXEkgi/X47mnmS6hwWPVIPnyJN2vB7Q2b/g4uYo3V21CGnBP9n8AnT6bd4cxcLOedmv0UD5TbSzDOGw++PCsBoeidjGh1/hA1FosU91qnjZNBhP5YnTsAzQ5qF7XR0ttCN/nA=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776325414;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:in-reply-to:in-reply-to:  references:references;\n bh=CnlEW6vCcBHQKV+dp1q+liVxEyBHgVMSX/EueFgChQM=;\n b=GZm89vicHlyBoY/ao5pu49nxUd3D7Gd+Lb0rih+ilW/FKBy+y/Ak0j5qUYSspuc1noFW2T\n TSCG4jg/pfgzXMiCl98/ptybnRRZRM5sVPNE1TB32kobbKHvIwY8FILJtSVoxH+rU2iPL3\n AzxUDNUoKWtc1VWrJdXbLJr6Ow7mkxs=","X-MC-Unique":"Fqabwh5dMKOuLpy2AjKGkA-1","X-Mimecast-MFC-AGG-ID":"Fqabwh5dMKOuLpy2AjKGkA_1776325409","Date":"Thu, 16 Apr 2026 09:43:25 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Richard Biener <rguenther@suse.de>","Cc":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>, gcc-patches@gcc.gnu.org,\n hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","Message-ID":"<aeCTHaB-S0GP_7C1@tucnak>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>\n <pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr>","MIME-Version":"1.0","In-Reply-To":"<pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr>","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.111","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"E1BPmRJSYLKdt4y5OluVsW6J9EIiZd8VBfObDlyQhv8_1776325409","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","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>","Reply-To":"Jakub Jelinek <jakub@redhat.com>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3677985,"web_url":"http://patchwork.ozlabs.org/comment/3677985/","msgid":"<q1p92s9q-335n-3508-sqs1-s10758n60s75@fhfr.qr>","list_archive_url":null,"date":"2026-04-16T07:57:29","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","submitter":{"id":4338,"url":"http://patchwork.ozlabs.org/api/people/4338/","name":"Richard Biener","email":"rguenther@suse.de"},"content":"On Thu, 16 Apr 2026, Jakub Jelinek wrote:\n\n> On Thu, Apr 16, 2026 at 08:52:22AM +0200, Richard Biener wrote:\n> > So I'm going with the inline variant with a testcase, see below for the\n> > updated patch.  The transparent union testcase is\n> > \n> > typedef union { unsigned char x; signed char y; }\n> > __attribute__((__transparent_union__)) T;\n> > void bar(int, T x);\n> > void foo(signed char x)\n> > {\n> >   bar(0, x);\n> > }\n> > \n> > where the difference is\n> > \n> > -       movl    %edi, %esi\n> > +       movzbl  %dil, %esi\n> >         movl    $0, %edi\n> >         call    bar\n> > \n> > I agree with Jakub that it makes sense to do this.  I have amended\n> > the documentation of the target hook accordingly.\n> > \n> > I'll apply later unless I hear otherwise.\n> \n> What about also\n> typedef union { unsigned char x; signed char y; }\n> __attribute__((__transparent_union__)) T;\n> void bar(int, T x);\n> void foo()\n> {\n>   bar(0, (T) { 42 });\n>   bar(1, (T) { -42 });\n> }\n> testcase?\n\nAh!  I tried\n\n  bar(0, 42);\n\nbut that's rejected.\n\n> Both gcc 15 and gcc 16 without your patch use\n>         movl    $42, %esi\n> and\n>         movl    $-42, %esi\n> I wonder if the latter shouldn't be $214 with your patch\n> because it should be passed as the first transparent union\n> member (which is unsigned char here).\n\nYes, and it does.  I'll add a third testcase with that.\n\nRichard.\n\n/* { dg-do compile } */\n/* { dg-options \"-O\" } */\n\ntypedef union { unsigned char x; signed char y; }\n__attribute__((__transparent_union__)) T;\nvoid bar(int, T x);\nvoid foo()\n{\n  bar(0, (T) { 42 });\n  bar(1, (T) { -42 });\n}\n\n/* PROMOTE_PROTOTYPES should make us pass 42 and 214, not -42, both would\n   be valid according to the ABI.  */\n/* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$42, %esi\" { target { ! \nia32 } } } } */\n/* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$214, %esi\" { target { ! \nia32 } } } } */","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=BlolvChn;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=+QtZP0I1;\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=BlolvChn;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=+QtZP0I1;\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=BlolvChn;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=+QtZP0I1;\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=BlolvChn;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=+QtZP0I1","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 4fx9Nm57jnz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 17:58:00 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 71F354BA2E23\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 07:57:58 +0000 (GMT)","from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131])\n by sourceware.org (Postfix) with ESMTPS id 8A7674BA2E04\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 07:57:30 +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 40BFF5BD1A;\n Thu, 16 Apr 2026 07:57:29 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 71F354BA2E23","OpenDKIM Filter v2.11.0 sourceware.org 8A7674BA2E04"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 8A7674BA2E04","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 8A7674BA2E04","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776326250; cv=none;\n b=N2AWhXVzuGocDnX3zhjzWNLWxdZaOijwflbrnnlY2VqYoAp7dgrLVOp15ANeyNcjLzZms7usSpQ/0zTUUG8XkL4FCBfF0AuSH92sZ5KmAMM23vr0g9apIX8dilXv+HJ5SY2QEMw3/MYC3RUMFeYbbTCGK5NBcx5ixtykjcbRlg8=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776326250; c=relaxed/simple;\n bh=X2VG4Rl1B+8efw4WRViCySYQoOPUmyMwsbCnsYHZdQA=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:Message-ID:MIME-Version;\n b=r9hGfO2OjnIygGlCZ6vBwLYVb3qKAT0FIeOzH5fGZ9+ZErwsOCeN22wqM0cBQ43ILA+GJzb8ybhFwfB1Mxkywt0kR1NAoQxoi3tT+ZEVt/PBFwejzjcbO0PMGN19wt2CJWcxgzH4r9UEV1+NLXIBxo0S+2WhjHDGrefRK7Vh5D4=","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=1776326249;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=qcJtcDDYXX6lCXz/EIa5dvOK5wQO9gUtfFgrwc3P4sM=;\n b=BlolvChn9O0qb9Tb+vThZyqV9SJQhuAztJUi3jSrjtkwd4fid1g1fzt+88BP7hblfkwUPr\n 1Z4zqndoS7vF9+6bTVKkMfs+Rm/osc+7RpR8ZSTehSorH0a9J8vn8E7LuvdTEHwJp9iBnw\n eWF7J2E9CtUyZjTvjROh/R2jkUWUszc=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776326249;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=qcJtcDDYXX6lCXz/EIa5dvOK5wQO9gUtfFgrwc3P4sM=;\n b=+QtZP0I1YuVXwwrzTqULy7rRLpNW6z6hjVAiSiNig6Fsgez7mhTdO0nMyJAIoSARV+vNku\n GDFDwv6a5ttsp7BA==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776326249;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=qcJtcDDYXX6lCXz/EIa5dvOK5wQO9gUtfFgrwc3P4sM=;\n b=BlolvChn9O0qb9Tb+vThZyqV9SJQhuAztJUi3jSrjtkwd4fid1g1fzt+88BP7hblfkwUPr\n 1Z4zqndoS7vF9+6bTVKkMfs+Rm/osc+7RpR8ZSTehSorH0a9J8vn8E7LuvdTEHwJp9iBnw\n eWF7J2E9CtUyZjTvjROh/R2jkUWUszc=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776326249;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=qcJtcDDYXX6lCXz/EIa5dvOK5wQO9gUtfFgrwc3P4sM=;\n b=+QtZP0I1YuVXwwrzTqULy7rRLpNW6z6hjVAiSiNig6Fsgez7mhTdO0nMyJAIoSARV+vNku\n GDFDwv6a5ttsp7BA=="],"Date":"Thu, 16 Apr 2026 09:57:29 +0200 (CEST)","From":"Richard Biener <rguenther@suse.de>","To":"Jakub Jelinek <jakub@redhat.com>","cc":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>, gcc-patches@gcc.gnu.org,\n hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","In-Reply-To":"<aeCTHaB-S0GP_7C1@tucnak>","Message-ID":"<q1p92s9q-335n-3508-sqs1-s10758n60s75@fhfr.qr>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>\n <pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr> <aeCTHaB-S0GP_7C1@tucnak>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","X-Spamd-Result":"default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n TAGGED_RCPT(0.00)[]; FUZZY_RATELIMITED(0.00)[rspamd.com];\n FREEMAIL_ENVRCPT(0.00)[gmail.com]; MISSING_XM_UA(0.00)[];\n ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+];\n RCVD_COUNT_ZERO(0.00)[0];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n URIBL_BLOCKED(0.00)[fhfr.qr:mid,murzim.nue2.suse.org:helo];\n FREEMAIL_CC(0.00)[oss.qualcomm.com,gcc.gnu.org,gmail.com];\n TO_DN_SOME(0.00)[]; FROM_HAS_DN(0.00)[];\n TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[];\n RCPT_COUNT_THREE(0.00)[4]","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"}},{"id":3677987,"web_url":"http://patchwork.ozlabs.org/comment/3677987/","msgid":"<aeCXUKPN5Bpkhqnu@tucnak>","list_archive_url":null,"date":"2026-04-16T08:01:20","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","submitter":{"id":671,"url":"http://patchwork.ozlabs.org/api/people/671/","name":"Jakub Jelinek","email":"jakub@redhat.com"},"content":"On Thu, Apr 16, 2026 at 09:57:29AM +0200, Richard Biener wrote:\n> /* { dg-do compile } */\n> /* { dg-options \"-O\" } */\n\n-masm=att in that case, because you match only AT&T syntax.\nOtherwise LGTM, thanks.\n\n> typedef union { unsigned char x; signed char y; }\n> __attribute__((__transparent_union__)) T;\n> void bar(int, T x);\n> void foo()\n> {\n>   bar(0, (T) { 42 });\n>   bar(1, (T) { -42 });\n> }\n> \n> /* PROMOTE_PROTOTYPES should make us pass 42 and 214, not -42, both would\n>    be valid according to the ABI.  */\n> /* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$42, %esi\" { target { ! \n> ia32 } } } } */\n> /* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$214, %esi\" { target { ! \n> ia32 } } } } */\n\n\tJakub","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=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=geygC4v3;\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 (1024-bit key,\n unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256\n header.s=mimecast20190719 header.b=geygC4v3","sourceware.org; dmarc=pass (p=quarantine dis=none)\n header.from=redhat.com","sourceware.org; spf=pass smtp.mailfrom=redhat.com","server2.sourceware.org;\n arc=none smtp.remote-ip=170.10.129.124"],"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 4fx9TP2K4Rz1yDF\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 18:02:01 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 5731A4BA2E10\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 08:01:59 +0000 (GMT)","from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by sourceware.org (Postfix) with ESMTP id 2CEDD4BA2E04\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 08:01:32 +0000 (GMT)","from mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com\n (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by\n relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3,\n cipher=TLS_AES_256_GCM_SHA384) id us-mta-587-ZK7kA82mMW6M8dZL2TSxdA-1; Thu,\n 16 Apr 2026 04:01:25 -0400","from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com\n (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mx-prod-mc-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS\n id 85522180060B; Thu, 16 Apr 2026 08:01:24 +0000 (UTC)","from tucnak.zalov.cz (unknown [10.44.33.129])\n by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with\n ESMTPS\n id F251F180047F; Thu, 16 Apr 2026 08:01:23 +0000 (UTC)","from tucnak.zalov.cz (localhost [127.0.0.1])\n by tucnak.zalov.cz (8.18.1/8.18.1) with ESMTPS id 63G81Lq0887940\n (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT);\n Thu, 16 Apr 2026 10:01:21 +0200","(from jakub@localhost)\n by tucnak.zalov.cz (8.18.1/8.18.1/Submit) id 63G81KK3887939;\n Thu, 16 Apr 2026 10:01:20 +0200"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 5731A4BA2E10","OpenDKIM Filter v2.11.0 sourceware.org 2CEDD4BA2E04"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org 2CEDD4BA2E04","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org 2CEDD4BA2E04","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776326492; cv=none;\n b=aSp10DSbixY/4GPyshol/0eamMTGZDwMMRPl7zuT9xxPsbEPeR+GVzXEEQ91KLX7N7XpnJyMMUJ5zzrpDA1sbA0e1UOIJ7FRPivN29kyDRiiw2o7k72V3XrhkDuiwpfKPn14my9/gMZ2nsbH2IHvB9x0OgtDEk/qiWdl3ed5f4g=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776326492; c=relaxed/simple;\n bh=O1Kn2gdxSX13SexotuyCpjn+8erTNBZBTfFYKg5zhcM=;\n h=DKIM-Signature:Date:From:To:Subject:Message-ID:MIME-Version;\n b=vQuyMbj741qK2aW0fC6DX57n04KYah6bvXH9pS/FRClHPc11TPLXJconaoqjB/AzB/lcUKaICjU0lTRUVDH2YksQRIfW60BrHy2+UsSyMcwewv2sZknW5K8EFDfX0tO6zYcfLhJ4xI1sUSGhwefrvs1R4cvgyQcz1I7j8ZxSpGU=","ARC-Authentication-Results":"i=1; server2.sourceware.org","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1776326491;\n h=from:from:reply-to:reply-to:subject:subject:date:date:\n message-id:message-id:to:to:cc:cc:mime-version:mime-version:\n content-type:content-type:in-reply-to:in-reply-to:  references:references;\n bh=HtTy1XjRLTNm0Kin136ONxPJ0caKi3us/mQmim5pAPU=;\n b=geygC4v3vrxfYrMDU8hdYvbGm4tT3PmeO1tsDeMwDo4HDga3WW3Tc81nHpGK1Q4BW5JRSK\n pNmwEzu8gws7tzUNWtICTQgFDZOhpVQg1/PCtVgUJCsSFRfelIZqJKt8geMayGysMWx9gm\n t8IJslXQexVt3flp/uQXqwW31Eu/zsk=","X-MC-Unique":"ZK7kA82mMW6M8dZL2TSxdA-1","X-Mimecast-MFC-AGG-ID":"ZK7kA82mMW6M8dZL2TSxdA_1776326484","Date":"Thu, 16 Apr 2026 10:01:20 +0200","From":"Jakub Jelinek <jakub@redhat.com>","To":"Richard Biener <rguenther@suse.de>","Cc":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>, gcc-patches@gcc.gnu.org,\n hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of PROMOTE_PROTOTYPES","Message-ID":"<aeCXUKPN5Bpkhqnu@tucnak>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>\n <pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr>\n <aeCTHaB-S0GP_7C1@tucnak>\n <q1p92s9q-335n-3508-sqs1-s10758n60s75@fhfr.qr>","MIME-Version":"1.0","In-Reply-To":"<q1p92s9q-335n-3508-sqs1-s10758n60s75@fhfr.qr>","X-Scanned-By":"MIMEDefang 3.4.1 on 10.30.177.93","X-Mimecast-Spam-Score":"0","X-Mimecast-MFC-PROC-ID":"wQKGPVEic4JiIEmymzppMq9JJoUonCzi3tpjuhUG2EY_1776326484","X-Mimecast-Originator":"redhat.com","Content-Type":"text/plain; charset=us-ascii","Content-Disposition":"inline","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>","Reply-To":"Jakub Jelinek <jakub@redhat.com>","Errors-To":"gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org"}},{"id":3677992,"web_url":"http://patchwork.ozlabs.org/comment/3677992/","msgid":"<22o96r26-s1r6-2nnp-8pn3-rp02938283pn@fhfr.qr>","list_archive_url":null,"date":"2026-04-16T08:11:07","subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","submitter":{"id":4338,"url":"http://patchwork.ozlabs.org/api/people/4338/","name":"Richard Biener","email":"rguenther@suse.de"},"content":"On Thu, 16 Apr 2026, Jakub Jelinek wrote:\n\n> On Thu, Apr 16, 2026 at 09:57:29AM +0200, Richard Biener wrote:\n> > /* { dg-do compile } */\n> > /* { dg-options \"-O\" } */\n> \n> -masm=att in that case, because you match only AT&T syntax.\n> Otherwise LGTM, thanks.\n\nNeeded for all testcases, -masm=intel prints movzbl as movzx.\n\nPushed with those fixes.\n\nRichard.\n\n> > typedef union { unsigned char x; signed char y; }\n> > __attribute__((__transparent_union__)) T;\n> > void bar(int, T x);\n> > void foo()\n> > {\n> >   bar(0, (T) { 42 });\n> >   bar(1, (T) { -42 });\n> > }\n> > \n> > /* PROMOTE_PROTOTYPES should make us pass 42 and 214, not -42, both would\n> >    be valid according to the ABI.  */\n> > /* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$42, %esi\" { target { ! \n> > ia32 } } } } */\n> > /* { dg-final { scan-assembler \"movl\\[ \\t\\]+\\\\\\$214, %esi\" { target { ! \n> > ia32 } } } } */\n> \n> \tJakub\n> \n>","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=saXTgkd2;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=4bP+S1PE;\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=saXTgkd2;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=4bP+S1PE;\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 (1024-bit key,\n unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256\n header.s=susede2_rsa header.b=saXTgkd2;\n\tdkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=4bP+S1PE;\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=saXTgkd2;\n\tdkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256\n header.s=susede2_ed25519 header.b=4bP+S1PE","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.130","smtp-out1.suse.de;\n\tnone"],"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 4fx9hX36ZQz1yCv\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 18:11:39 +1000 (AEST)","from vm01.sourceware.org (localhost [127.0.0.1])\n\tby sourceware.org (Postfix) with ESMTP id 270654BA2E2D\n\tfor <incoming@patchwork.ozlabs.org>; Thu, 16 Apr 2026 08:11:37 +0000 (GMT)","from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130])\n by sourceware.org (Postfix) with ESMTPS id EB1634BA2E05\n for <gcc-patches@gcc.gnu.org>; Thu, 16 Apr 2026 08:11:08 +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-out1.suse.de (Postfix) with ESMTPS id CB3C26A7F4;\n Thu, 16 Apr 2026 08:11:07 +0000 (UTC)"],"DKIM-Filter":["OpenDKIM Filter v2.11.0 sourceware.org 270654BA2E2D","OpenDKIM Filter v2.11.0 sourceware.org EB1634BA2E05"],"DMARC-Filter":"OpenDMARC Filter v1.4.2 sourceware.org EB1634BA2E05","ARC-Filter":"OpenARC Filter v1.0.0 sourceware.org EB1634BA2E05","ARC-Seal":"i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1776327069; cv=none;\n b=giiOiK5oiyTdPQxaTCQITjRGyNhI5ZRgvmAthSi3NwbnXeTot1IgrdhiBuwIInqfxXWJ1Pw/yx2XS0JP/t4saSeT4ckOioRIoHWG1dYt5OIwQ903A9HScQ5PB+0HI8/kJI44ULyCm408qvKiejIH6NKv4zdf91mfr8s/utCMGlE=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=sourceware.org; s=key;\n t=1776327069; c=relaxed/simple;\n bh=5TjifBdB6ZF7J9X1GHgeJAvr+NZjm5i9XpeTZAIAxRo=;\n h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date:\n From:To:Subject:Message-ID:MIME-Version;\n b=YjO5jm6uLP4Mgit17HjQ8GZR8ZcsHYEHmy+wqL81adf3Vlf+WNPmXf7VvxKUFfVnQ8GFb4lay3fBqQOe2ilvnIksHLMOcQfh9l9C3RgXTGnGJy/yIj9mj1dnfdfZpmy7pwXcpY/E581iK3hhTAS/+jjRzfrDFdhUfXDfNpxuYzo=","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=1776327067;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ulrNohJcz4bZZYgGUmyXWSfaQwYgMY2dl7KaXdCwlOU=;\n b=saXTgkd2N5bxtg6cpROQtK/Xe3V+r55MQTr5rnmi4AsoEYwZ+Lxqzfpra5Zbg/J98lMv1w\n IYPjghG0IKMenMTj5z6OBcU6lMYJleT5PK7HTGAOm+TOnVRmMnKX0fLsBUCLJnTZINZTds\n UXR7fMWmAi5WMF1OO7I687d1P2x56Oo=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776327067;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ulrNohJcz4bZZYgGUmyXWSfaQwYgMY2dl7KaXdCwlOU=;\n b=4bP+S1PEERZV22zJElG0hjyqSVzZ8AE43hRKlIEIYRPNzZS0ZH23vZWU9DLV00dKTQQ67A\n iyBBP3k7hpL+xFDQ==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_rsa;\n t=1776327067;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ulrNohJcz4bZZYgGUmyXWSfaQwYgMY2dl7KaXdCwlOU=;\n b=saXTgkd2N5bxtg6cpROQtK/Xe3V+r55MQTr5rnmi4AsoEYwZ+Lxqzfpra5Zbg/J98lMv1w\n IYPjghG0IKMenMTj5z6OBcU6lMYJleT5PK7HTGAOm+TOnVRmMnKX0fLsBUCLJnTZINZTds\n UXR7fMWmAi5WMF1OO7I687d1P2x56Oo=","v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de;\n s=susede2_ed25519; t=1776327067;\n h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc:\n mime-version:mime-version:content-type:content-type:\n in-reply-to:in-reply-to:references:references;\n bh=ulrNohJcz4bZZYgGUmyXWSfaQwYgMY2dl7KaXdCwlOU=;\n b=4bP+S1PEERZV22zJElG0hjyqSVzZ8AE43hRKlIEIYRPNzZS0ZH23vZWU9DLV00dKTQQ67A\n iyBBP3k7hpL+xFDQ=="],"Date":"Thu, 16 Apr 2026 10:11:07 +0200 (CEST)","From":"Richard Biener <rguenther@suse.de>","To":"Jakub Jelinek <jakub@redhat.com>","cc":"Jeffrey Law <jeffrey.law@oss.qualcomm.com>, gcc-patches@gcc.gnu.org,\n hjl.tools@gmail.com","Subject":"Re: [PATCH] middle-end/124877 - fix mis-apply of\n PROMOTE_PROTOTYPES","In-Reply-To":"<aeCXUKPN5Bpkhqnu@tucnak>","Message-ID":"<22o96r26-s1r6-2nnp-8pn3-rp02938283pn@fhfr.qr>","References":"<20260414111602.4D2654B3FA@imap1.dmz-prg2.suse.org>\n <24a8bfa0-3645-4a55-b2e8-cd1f404dd136@oss.qualcomm.com>\n <pp6o7824-1467-nnpp-sqo6-35q98305pqq3@fhfr.qr> <aeCTHaB-S0GP_7C1@tucnak>\n <q1p92s9q-335n-3508-sqs1-s10758n60s75@fhfr.qr>\n <aeCXUKPN5Bpkhqnu@tucnak>","MIME-Version":"1.0","Content-Type":"text/plain; charset=US-ASCII","X-Spamd-Result":"default: False [-2.80 / 50.00]; BAYES_HAM(-3.00)[100.00%];\n SUSPICIOUS_RECIPS(1.50)[]; NEURAL_HAM_LONG(-1.00)[-1.000];\n NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain];\n FUZZY_RATELIMITED(0.00)[rspamd.com]; ARC_NA(0.00)[];\n MIME_TRACE(0.00)[0:+]; TO_DN_SOME(0.00)[];\n MISSING_XM_UA(0.00)[]; TAGGED_RCPT(0.00)[];\n FREEMAIL_ENVRCPT(0.00)[gmail.com]; RCPT_COUNT_THREE(0.00)[4];\n FROM_HAS_DN(0.00)[];\n FREEMAIL_CC(0.00)[oss.qualcomm.com,gcc.gnu.org,gmail.com];\n RCVD_COUNT_ZERO(0.00)[0]; FROM_EQ_ENVFROM(0.00)[];\n DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519];\n TO_MATCH_ENVRCPT_ALL(0.00)[];\n DBL_BLOCKED_OPENRESOLVER(0.00)[murzim.nue2.suse.org:helo, fhfr.qr:mid,\n suse.de:email]","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"}}]