From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5C21F3858D35; Mon, 26 Jun 2023 04:28:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5C21F3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1687753708; bh=itQp5xadyUbzf7E+9QaYknh3vh6SeDnSTpcdB9esZtM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Bv7mHuNo4emg6Okv2Fm4TYwK8XZD8QqdGEabP/d73ngzhPL3tYcPl/1bB0GRMLtS6 BwB4Ews3il0v5iUYsdQYX3BhppTs2tCL2aPHFIJMEvjCSw3xwl5DEKk2MQ8Mo31AZ4 DoooSmX5IZnwbqeZYICqzqCNCKk8ks7w2/CvTeyU= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/110406] d: Wrong code-gen returning POD structs by value Date: Mon, 26 Jun 2023 04:28:28 +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: 13.1.0 X-Bugzilla-Keywords: ABI X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: keywords 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D110406 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |ABI --- Comment #6 from Andrew Pinski --- (In reply to Andrew Pinski from comment #5) > (In reply to ibuclaw from comment #3) > > (In reply to Andrew Pinski from comment #2) > > > >structs have been set the wrong mode > > >=20 > > > No, they don't have wrong mode, just the x86_64 backend is broken, se= e bug > > > 102027 comment #7 specifically. > > I think they do. > >=20 > > On 64-bit, I expect the mode set by compute_record_mode to be TImode.= =20 > > However what I'm instead seeing is BLKmode. This tells me I might be ca= lling > > it too early, and some fields yet to have their DECL_SIZE set. >=20 > Unless the struct has the alignment of TImode, it should be BLKmode ... here is a C testcase to get it returned into vector register (incorrectly d= ue to the alignment being set to 32): ``` typedef unsigned uint; struct cpuid_abcd_t { uint eax; uint ebx; uint ecx; uint edx; } __attribute__((aligned(8*4))); struct cpuid_abcd_t cpuid_insn(const uint in_eax) { struct cpuid_abcd_t ret=3D{}; asm ( "cpuid" : "=3Da" ( ret.eax ), "=3Db" ( ret.ebx ), "=3Dc" ( ret.ecx ), "=3Dd" ( ret.edx ) : "a" ( in_eax ) : ); return ret; } ``` Which itself is GCC 12+ regression too ...=