From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 7BEE23858D33; Fri, 14 Apr 2023 09:36:35 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7BEE23858D33 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1681464995; bh=Bkz43U/S+w8/xkFv0lorEZEP5Uf1oi9h4jd5kpuo/BY=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MIsaw+3VjX+nA+ljBaviKxwZtSxbw55CGVHAf37s1h5+z8jV/4rf9YbX11MJfuaeM /meIba9rzbWwbB5+p13Axftko0jqXgtjVXFVTdLC4KQuu/63p6sqMFsY+Bexb3+Jy3 wiF6vjv2d1yOV+dKuL2UXMt/xOeelwbYrmkWamw8= From: "jakub at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug bootstrap/109510] [13 Regression] bootstrap with Ada broken on aarch64 Date: Fri, 14 Apr 2023 09:36:34 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: bootstrap X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: build X-Bugzilla-Severity: normal X-Bugzilla-Who: jakub at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P1 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109510 --- Comment #5 from Jakub Jelinek --- (In reply to Richard Biener from comment #3) > (In reply to Eric Botcazou from comment #2) > > > Maybe Eric can clarify which type kinds in Ada can have TYPE_USER_ALI= GN and > > > _not_ a TYPE_MAIN_VARIANT without. > >=20 > > All of them, TYPE_USER_ALIGN is supposed to be orthogonal to type varia= nts. >=20 > How do you get at the alignment the type would have when the user didn't > specify it? That's what the call ABI is supposed to look at. >=20 > /* 1 if the alignment for this type was requested by "aligned" attribute, > 0 if it is the default for this type. */ > #define TYPE_USER_ALIGN(NODE) (TYPE_CHECK (NODE)->base.u.bits.user_align) >=20 > so what's the "default" alignment? What stor-layout.cc sets it to. For scalar types on targets which don't define ROUND_TYPE_ALIGN, I think it= is usually (see stor-layout.cc (finalize_type_size)) GET_MODE_ALIGNMENT (TYPE_MODE (type)), for vector types targetm.vector_alignment (type). AGGREGATE_TYPE_Ps should have their specified user alignment honored. The reason why we shouldn't take user alignment into account for ABI argume= nt and return value passing is e.g. because useless_type_conversion_p doesn't really take that user alignment on the scalar types into account. E.g. integer type conversions are considered equal if they have same mode, = same signedness and same precision, scalar floats if they have same mode, pointers/references indeed same mode and same address space, vectors have s= ome extra rules as well, but none of that takes into account the alignment. So, what exact type you get in t= he call vs. what exact type the callee expects might have different alignment,= and it is the default alignment that should matter there (solely).=