From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id F379E385801B; Wed, 30 Mar 2022 19:02:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F379E385801B From: "xry111 at mengyan1223 dot wang" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/102024] [12 Regression] zero width bitfields and ABIs Date: Wed, 30 Mar 2022 19:02:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 12.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: xry111 at mengyan1223 dot wang X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 12.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 19:02:08 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102024 --- Comment #30 from Xi Ruoyao --- (In reply to Jakub Jelinek from comment #28) > Also, what does LLVM do? clang-14 agree with gcc-12 on the return values, as we expected (the ABI documentation is clear enough). But clang-14 treats arguments differently: struct foo { int : 0; double a; int : 0; double b; int : 0; }; extern void func(struct foo); void pass_foo(void) { struct foo test; test.a =3D 114; test.b =3D 514; func(test); } It puts "a" into $f12 and "b" into $f13. So the behavior of clang-14 and clang++-14 handling arguments with zero-width bit-fields is same as g++-11,= and different from g++-12, gcc-11, and gcc-12. I'm not sure if we should keep our current behavior, or change it to match LLVM.=