public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members
       [not found] <bug-91672-4@http.gcc.gnu.org/bugzilla/>
@ 2024-03-14 20:06 ` pinskia at gcc dot gnu.org
  2024-03-14 20:12 ` pinskia at gcc dot gnu.org
  2024-03-14 20:17 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-14 20:06 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=102295

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the C++ sizes was recorded as PR 102295 .

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

* [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members
       [not found] <bug-91672-4@http.gcc.gnu.org/bugzilla/>
  2024-03-14 20:06 ` [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members pinskia at gcc dot gnu.org
@ 2024-03-14 20:12 ` pinskia at gcc dot gnu.org
  2024-03-14 20:17 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-14 20:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Note the .size does match up with what GCC outputs though:
e.g. a1:
        .size   a1, 18
a1:
        .xword  1
        .hword  1
        .hword  1
        .zero   6

that is size of 18.
Basically gcc's padding is always 6 in size and not changing based on the size
that is needed there.

This is also normally how you get the size when allocating dynamically too:

sizeof(struct A) + N*sizeof(__INT16_TYPE__).

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

* [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members
       [not found] <bug-91672-4@http.gcc.gnu.org/bugzilla/>
  2024-03-14 20:06 ` [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members pinskia at gcc dot gnu.org
  2024-03-14 20:12 ` pinskia at gcc dot gnu.org
@ 2024-03-14 20:17 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-03-14 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pascal_cuoq at hotmail dot com

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 109956 has been marked as a duplicate of this bug. ***

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-91672-4@http.gcc.gnu.org/bugzilla/>
2024-03-14 20:06 ` [Bug c/91672] wrong amount of storage allocated for initialized structs with flexible array members pinskia at gcc dot gnu.org
2024-03-14 20:12 ` pinskia at gcc dot gnu.org
2024-03-14 20:17 ` 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).