On Mon, Dec 2, 2024 at 2:01 AM Lewis Hyatt <lhy...@gmail.com> wrote:
>
> This patch was previously discussed here:
> https://gcc.gnu.org/pipermail/gcc-patches/2024-November/669437.html
>
> This version addresses that feedback, and I have also moved it in the patch
> ordering to be after the change to 64-bit location_t, since it would be
> inaccurate prior to that.
>
> -- >8 --
>
> The size of struct gimple increased by 8 bytes with the change in size of
> location_t from 32- to 64-bit; adjust the WORD markings in the comments
> accordingly. It seems that most of the WORD markings were off by one already,
> probably not having been updated after a previous reduction in the size of a
> gimple, so they have become retroactively correct again, and only a couple
> needed adjustment actually.
>
> Also add an explicit 32-bit padding member to struct gimple for clarity.
>
> gcc/ChangeLog:
>
>         * gimple.h (struct gphi): Update word marking comments to reflect
>         the new size of location_t.
>         (struct gimple): Likewise. Add gimple::pad2 explicit padding member.
> ---
>  gcc/gimple.h | 18 +++++++++++-------
>  1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/gcc/gimple.h b/gcc/gimple.h
> index 039ed66eab5..1eb880ab60a 100644
> --- a/gcc/gimple.h
> +++ b/gcc/gimple.h
> @@ -259,23 +259,27 @@ struct GTY((desc ("gimple_statement_structure (&%h)"), 
> tag ("GSS_BASE"),
>       in there.  */
>    unsigned int subcode         : 16;
>
> -  /* UID of this statement.  This is used by passes that want to
> +  /* Unused padding.  */
> +  unsigned int pad2 : 32;
> +

It occurs to me this makes things worse on 32bit hosts, so please change it to
a comment only

     /* Unused 32bits padding on 64bit hosts.  */

OK with that change.

Richard.


> +  /* [ WORD 2 ]
> +     UID of this statement.  This is used by passes that want to
>       assign IDs to statements.  It must be assigned and used by each
>       pass.  By default it should be assumed to contain garbage.  */
>    unsigned uid;
>
> -  /* [ WORD 2 ]
> -     Locus information for debug info.  */
> -  location_t location;
> -
>    /* Number of operands in this tuple.  */
>    unsigned num_ops;
>
>    /* [ WORD 3 ]
> +     Locus information for debug info.  */
> +  location_t location;
> +
> +  /* [ WORD 4 ]
>       Basic block holding this statement.  */
>    basic_block bb;
>
> -  /* [ WORD 4-5 ]
> +  /* [ WORD 5-6 ]
>       Linked lists of gimple statements.  The next pointers form
>       a NULL terminated list, the prev pointers are a cyclic list.
>       A gimple statement is hence also a double-ended list of
> @@ -479,7 +483,7 @@ struct GTY((tag("GSS_PHI")))
>    /* [ WORD 8 ]  */
>    tree result;
>
> -  /* [ WORD 9 ]  */
> +  /* [ WORD 9-14 ]  */
>    struct phi_arg_d GTY ((length ("%h.nargs"))) args[1];
>  };
>

Reply via email to