diff options
author | Artemiy Granat <a.granat@ispras.ru> | 2025-07-29 17:20:46 +0300 |
---|---|---|
committer | Alexander Monakov <amonakov@ispras.ru> | 2025-07-31 15:47:33 +0300 |
commit | ccead81bbc39668376eb5cf47066acb446cc43f3 (patch) | |
tree | 5757c9c2edbb80de5675d3903bab04a4ebc8c4c1 /gcc/rust/parse/rust-parse-impl.h | |
parent | ff6f7d8e005ae94ffd55f1dba727e28531c3daf3 (diff) | |
download | gcc-ccead81bbc39668376eb5cf47066acb446cc43f3.zip gcc-ccead81bbc39668376eb5cf47066acb446cc43f3.tar.gz gcc-ccead81bbc39668376eb5cf47066acb446cc43f3.tar.bz2 |
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-seanjc@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.
Diffstat (limited to 'gcc/rust/parse/rust-parse-impl.h')
0 files changed, 0 insertions, 0 deletions