public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/113977] New: debug info for alignment of structure is unspecified
@ 2024-02-18  2:06 tsqurt at outlook dot com
  2024-02-18  2:29 ` [Bug debug/113977] " pinskia at gcc dot gnu.org
                   ` (13 more replies)
  0 siblings, 14 replies; 15+ messages in thread
From: tsqurt at outlook dot com @ 2024-02-18  2:06 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113977

            Bug ID: 113977
           Summary: debug info for alignment of structure is unspecified
           Product: gcc
           Version: 13.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tsqurt at outlook dot com
  Target Milestone: ---

Created attachment 57454
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57454&action=edit
src.c

GCC does not generate complete debug information for my C code when generating
debug information. The alignment requirement for my structures is 1, but the
debugger believes their alignment requirement is 8 (which is likely inherited
from the default structure alignment requirement on the platform). 
I'm using the AMD64 instruction set, and the operating system is Ubuntu 20.04.6
LTS on Windows Subsystem for Linux.

To reproduce this issue, follow these steps with the attached code:

gcc src.c -gdwarf-5 -o a.out && gdb a.out
(gdb) b 13
Breakpoint 1 at 0x1170: file src.c, line 13.
(gdb) run
Starting program: a.out 

Breakpoint 1, main () at src.c:13
13        return 0;
(gdb) expr z[0]._[0] = 1
(gdb) expr y[0]._[0] = 1
(gdb) expr x[0]._[0] = 1
gdb command line:1:1: error: alignment of array elements is greater than
element size
Compilation failed.
(gdb) 

GDB reports that the alignment requirement for these structures is 8, but it is
1.

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2024-03-07  8:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18  2:06 [Bug debug/113977] New: debug info for alignment of structure is unspecified tsqurt at outlook dot com
2024-02-18  2:29 ` [Bug debug/113977] " pinskia at gcc dot gnu.org
2024-02-18  2:32 ` [Bug libcc1/113977] " pinskia at gcc dot gnu.org
2024-02-18  2:35 ` pinskia at gcc dot gnu.org
2024-02-18  2:41 ` tsqurt at outlook dot com
2024-02-18  2:47 ` pinskia at gcc dot gnu.org
2024-02-18  2:48 ` pinskia at gcc dot gnu.org
2024-02-18  2:58 ` pinskia at gcc dot gnu.org
2024-02-18  3:06 ` pinskia at gcc dot gnu.org
2024-02-20 18:27 ` tromey at gcc dot gnu.org
2024-02-20 18:32 ` pinskia at gcc dot gnu.org
2024-02-22  1:46 ` tromey at gcc dot gnu.org
2024-02-29 16:08 ` cvs-commit at gcc dot gnu.org
2024-02-29 16:34 ` tromey at gcc dot gnu.org
2024-03-07  8:20 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).