From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A301386000D; Sun, 18 Feb 2024 02:47:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A301386000D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708224452; bh=wAdJB53WhMVxmPU1YW7Wym6HmCADhCyQN0P7NDxj2d4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=rTfDtCCohNfrj3jVibnIIblqJBhfDj5hvYQV7vsMpvk/hPRrfBcG640RN2vpVvQVu ntPzo4arbikvXtLQaUutEYNy/Cj7JgW5+HbHHi0oVHEPkkvy8V0R66Qi2jQeI9iWOD 0LgfUhJoRlr31eHtR7GI0X3hllyaQHOO3BHKonYQ= From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libcc1/113977] debug info for alignment of structure is unspecified Date: Sun, 18 Feb 2024 02:47:32 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libcc1 X-Bugzilla-Version: 13.2.0 X-Bugzilla-Keywords: 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: 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=3D113977 --- Comment #5 from Andrew Pinski --- (In reply to Tan Senqi from comment #4) > (In reply to Andrew Pinski from comment #3) > I think gcc can generate a DW_AT_alignment for my struct to solve this > problem. But why the alignment is considered as 8, I am not sure about th= is. > If it is inherited from the default structure alignment requirement on the > platform, then gcc should specify alignment for those whose alignment is = not > 8. Or 8 is not the default value by DWARF5(i.e. undefined), then it is > surely a bug in gdb. So reading the definition of DW_AT_alignment, it is if the alignment is not= the default for that type. In this case it should be 1 as char arrays have alignment of 1 inside structs. See https://dwarfstd.org/issues/140528.1.html for the definition. in this case the ABI specifies the alignment and GCC does not need to emit DW_AT_alignment since it is not different from the ABI. This would mean the= bug is in gdb's gcc_convert_symbol, eg.: ``` gcc_convert_symbol "z": local symbol gdb command line:1:1: error: size of array element is not a multiple of its alignment ``` I am testing the trunk gdb right now to see if it was fixed.=