From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9A32A386075C; Sun, 18 Feb 2024 02:41:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9A32A386075C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1708224077; bh=NzrD7ZVC+Julw8NOdg0pROBplgO67aW7wXgCeUDALTc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=pSor3Pyo2TWCbyWyTL/ouMWrwa73sIn/AW6khnTW4gJy5lU5uR2qNhUR3ejold6fn ZstUQ42QLr5GfNWn2agvXPioAsWyqP5o6STGAeA/W8ZRb7KgPX4xZcrL+HVjhxz3D7 6cSt6JHVKENWpivAz+qeVbQ5FievqNqi+G5Sm7Lk= From: "tsqurt at outlook dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libcc1/113977] debug info for alignment of structure is unspecified Date: Sun, 18 Feb 2024 02:41:15 +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: tsqurt at outlook dot com 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 #4 from Tan Senqi --- (In reply to Andrew Pinski from comment #3) > For me with the trunk GCC we get: > ``` > (gdb) expr z[0]._[0] =3D 1 > gdb command line:1:1: error: size of array element is not a multiple of i= ts > alignment > Compilation failed. > (gdb) expr y[0]._[0] =3D 1 > (gdb) expr x[0]._[0] =3D 1 > gdb command line:1:1: error: alignment of array elements is greater than > element size > Compilation failed. >=20 > ``` >=20 > I am starting to think this is a gdb issue ... I think gcc can generate a DW_AT_alignment for my struct to solve this prob= lem. But why the alignment is considered as 8, I am not sure about this. 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.=