public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment
@ 2024-02-18  2:57 pinskia at gcc dot gnu.org
  2024-02-18  2:57 ` [Bug compile/31397] " pinskia at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-18  2:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

            Bug ID: 31397
           Summary: arrays with structs with arrays gets the wrong
                    alignment
           Product: gdb
           Version: unknown
            Status: NEW
          Severity: normal
          Priority: P2
         Component: compile
          Assignee: unassigned at sourceware dot org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---

```
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 

(gdb) expr z[0]._[0] = 1
gdb command line:1:1: error: size of array element is not a multiple of its
alignment
Compilation failed.
(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.
```

Running with the trunk gcc and the trunk gdb here and this fails.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
@ 2024-02-18  2:57 ` pinskia at gcc dot gnu.org
  2024-02-18  3:01 ` pinskia at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-18  2:57 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 15375
  --> https://sourceware.org/bugzilla/attachment.cgi?id=15375&action=edit
src.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
  2024-02-18  2:57 ` [Bug compile/31397] " pinskia at gcc dot gnu.org
@ 2024-02-18  3:01 ` pinskia at gcc dot gnu.org
  2024-02-18  6:59 ` sam at gentoo dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-18  3:01 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This was originally reported on the gcc side
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113977) but the debug info seems
correct. Since the default alignment is specified, it seems like
gcc_convert_symbol is adding the wrong alignment for the struct which causes
gcc to reject the array definition. The alignment of s7, s8, and s9 are all 1
since it has an array of char's.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
  2024-02-18  2:57 ` [Bug compile/31397] " pinskia at gcc dot gnu.org
  2024-02-18  3:01 ` pinskia at gcc dot gnu.org
@ 2024-02-18  6:59 ` sam at gentoo dot org
  2024-02-18 10:23 ` ssbssa at sourceware dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: sam at gentoo dot org @ 2024-02-18  6:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

Sam James <sam at gentoo dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |sam at gentoo dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2024-02-18  6:59 ` sam at gentoo dot org
@ 2024-02-18 10:23 ` ssbssa at sourceware dot org
  2024-02-20 18:25 ` tromey at sourceware dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ssbssa at sourceware dot org @ 2024-02-18 10:23 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

Hannes Domani <ssbssa at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ssbssa at sourceware dot org

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2024-02-18 10:23 ` ssbssa at sourceware dot org
@ 2024-02-20 18:25 ` tromey at sourceware dot org
  2024-02-22  1:46 ` tromey at sourceware dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at sourceware dot org @ 2024-02-20 18:25 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #3 from Tom Tromey <tromey at sourceware dot org> ---
I think this requires a combination fix, since
the protocol doesn't allow for alignment.
I'll comment on the gcc bug.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2024-02-20 18:25 ` tromey at sourceware dot org
@ 2024-02-22  1:46 ` tromey at sourceware dot org
  2024-02-29 22:38 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at sourceware dot org @ 2024-02-22  1:46 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at sourceware dot org   |tromey at sourceware dot org

--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
I have a patch.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2024-02-22  1:46 ` tromey at sourceware dot org
@ 2024-02-29 22:38 ` cvs-commit at gcc dot gnu.org
  2024-03-14 15:56 ` cvs-commit at gcc dot gnu.org
  2024-03-14 15:56 ` tromey at sourceware dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-02-29 22:38 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

--- Comment #5 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f9771d0e80c3a98e865c7ee5139cadf9d73db436

commit f9771d0e80c3a98e865c7ee5139cadf9d73db436
Author: Tom Tromey <tom@tromey.com>
Date:   Tue Feb 20 17:15:03 2024 -0700

    Synchronize GCC compile plugin headers

    This patch copies some changes to the compile headers from GCC's
    include/ directory.  It is the gdb equivalent of the GCC commit
    bc0e18a9 -- however, while that commit also necessarily touched
    libcc1, this one of course does not.

    Tested by rebuilding and also running the gdb.compile tests.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31397

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2024-02-29 22:38 ` cvs-commit at gcc dot gnu.org
@ 2024-03-14 15:56 ` cvs-commit at gcc dot gnu.org
  2024-03-14 15:56 ` tromey at sourceware dot org
  8 siblings, 0 replies; 10+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2024-03-14 15:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

--- Comment #6 from Sourceware Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Tom Tromey <tromey@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=91e15dbaf9d05747fab0d33e5af7ae69c983398a

commit 91e15dbaf9d05747fab0d33e5af7ae69c983398a
Author: Tom Tromey <tom@tromey.com>
Date:   Wed Feb 21 08:22:01 2024 -0700

    Pass alignment when using GCC_C_FE_VERSION_2

    When the GCC compiler plugin responds with GCC_C_FE_VERSION_2, gdb can
    use the new 'finish_record_with_alignment' method.  This lets gdb pass
    alignment information to the compiler, which in turn fixes the test
    case included in this patch.

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31397

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug compile/31397] arrays with structs with arrays gets the wrong alignment
  2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2024-03-14 15:56 ` cvs-commit at gcc dot gnu.org
@ 2024-03-14 15:56 ` tromey at sourceware dot org
  8 siblings, 0 replies; 10+ messages in thread
From: tromey at sourceware dot org @ 2024-03-14 15:56 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=31397

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |15.1

--- Comment #7 from Tom Tromey <tromey at sourceware dot org> ---
Fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2024-03-14 15:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-18  2:57 [Bug compile/31397] New: arrays with structs with arrays gets the wrong alignment pinskia at gcc dot gnu.org
2024-02-18  2:57 ` [Bug compile/31397] " pinskia at gcc dot gnu.org
2024-02-18  3:01 ` pinskia at gcc dot gnu.org
2024-02-18  6:59 ` sam at gentoo dot org
2024-02-18 10:23 ` ssbssa at sourceware dot org
2024-02-20 18:25 ` tromey at sourceware dot org
2024-02-22  1:46 ` tromey at sourceware dot org
2024-02-29 22:38 ` cvs-commit at gcc dot gnu.org
2024-03-14 15:56 ` cvs-commit at gcc dot gnu.org
2024-03-14 15:56 ` tromey at sourceware dot 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).