On Tue, Jul 29, 2025 at 6:58 PM Uros Bizjak <ubiz...@gmail.com> wrote: > > On Tue, Jul 29, 2025 at 5:04 PM <a.gra...@ispras.ru> wrote: > > > > On 2025-07-25 11:18, Uros Bizjak wrote: > > > On Thu, Jul 24, 2025 at 5:35 PM Artemiy Granat <a.gra...@ispras.ru> > > > wrote: > > >> > > >> gcc/testsuite/ChangeLog: > > >> > > >> * g++.dg/abi/regparm1.C: Use regparm attribute only if not in > > >> 64-bit mode. > > >> * gcc.target/i386/20020224-1.c: Likewise. > > >> * gcc.target/i386/pr103785.c: Likewise. > > >> * gcc.target/i386/pr36533.c: Likewise. > > >> * gcc.target/i386/pr59099.c: Likewise. > > >> * gcc.target/i386/sibcall-8.c: Likewise. > > >> * gcc.target/i386/sw-1.c: Likewise. > > >> * gcc.target/i386/pr15184-2.c: Fix invalid comment. > > >> * gcc.target/i386/attributes-ignore.c: New test. > > > > > > Please enable testcases that explicitly test regparm attribute only > > > for ix86 targets using ia32 target selector. They are irrelevant for > > > x86_64 anyway. > > > > I've set ia32 target as required for regparm1.C and 20020224-1.c. Other > > tests are useful in 64-bit mode too. > > > > ---8<--- > > > > From 1e966334eda2e4455190455554333fe86cb9ab50 Mon Sep 17 00:00:00 2001 > > From: Artemiy Granat <a.gra...@ispras.ru> > > Date: Tue, 29 Jul 2025 17:20:46 +0300 > > Subject: [PATCH] i386: Ignore regparm attribute and warn for it in > > 64-bit mode > > > > The regparm attribute does not affect code generation on x86-64 target. > > Despite this, regparm was accepted silently, unlike other calling > > convention attributes handled in the ix86_handle_cconv_attribute > > function. > > > > Due to lack of diagnostics, Linux kernel attempted to specify regparm(0) > > on vmread_error_trampoline declaration, which is supposed to be invoked > > with all arguments on stack: > > https://lore.kernel.org/all/20220928232015.745948-1-sea...@google.com/ > > > > To produce a warning for regparm in 64-bit mode, simply move the block > > that produces diagnostics above the block that handles the regparm > > attribute. > > > > gcc/ChangeLog: > > > > * config/i386/i386-options.cc (ix86_handle_cconv_attribute): > > Move 64-bit mode check before regparm handling. > > > > gcc/testsuite/ChangeLog: > > > > * g++.dg/abi/regparm1.C: Require ia32 target. > > * gcc.target/i386/20020224-1.c: Likewise. > > * gcc.target/i386/pr103785.c: Use regparm attribute only if > > not in 64-bit mode. > > * gcc.target/i386/pr36533.c: Likewise. > > * gcc.target/i386/pr59099.c: Likewise. > > * gcc.target/i386/sibcall-8.c: Likewise. > > * gcc.target/i386/sw-1.c: Likewise. > > * gcc.target/i386/pr15184-2.c: Fix invalid comment. > > * gcc.target/i386/attributes-ignore.c: New test. > > OK.
BTW: How do you plan to go forward with these patches? If you don't have compyright assignment then we need your Signed-off-by: on the patches, please read "Legal Prerequisites" of https://gcc.gnu.org/contribute.html . Also, -q- If you do not have write access and a patch of yours has been approved, but not committed, please advise the approver of that fact. You may want to point out lack of write access in your initial submission, too. -/q- Uros.