public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/108623] We need to grow the precision field in tree_type_common for PowerPC
Date: Wed, 01 Feb 2023 08:18:33 +0000	[thread overview]
Message-ID: <bug-108623-4-1snZKRraVt@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108623-4@http.gcc.gnu.org/bugzilla/>

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|other                       |middle-end
             Target|                            |powerpc*

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
There are 15 spare bits at the end of the bits, a better solution is to
re-order things so precision remains aligned to 16 bits, for example by moving
the
6 bits adjacent to it to the "spare" and extending precision to a full 16 bits.

Like with the following which aligns all >1 bit fields to at least 8 bits

diff --git a/gcc/tree-core.h b/gcc/tree-core.h
index acd8deea34e..e5513208511 100644
--- a/gcc/tree-core.h
+++ b/gcc/tree-core.h
@@ -1686,18 +1686,8 @@ struct GTY(()) tree_type_common {
   tree attributes;
   unsigned int uid;

-  unsigned int precision : 10;
-  unsigned no_force_blk_flag : 1;
-  unsigned needs_constructing_flag : 1;
-  unsigned transparent_aggr_flag : 1;
-  unsigned restrict_flag : 1;
-  unsigned contains_placeholder_bits : 2;
-
+  unsigned int precision : 16;
   ENUM_BITFIELD(machine_mode) mode : 8;
-
-  /* TYPE_STRING_FLAG for INTEGER_TYPE and ARRAY_TYPE.
-     TYPE_CXX_ODR_P for RECORD_TYPE and UNION_TYPE.  */
-  unsigned string_flag : 1;
   unsigned lang_flag_0 : 1;
   unsigned lang_flag_1 : 1;
   unsigned lang_flag_2 : 1;
@@ -1713,12 +1703,22 @@ struct GTY(()) tree_type_common {
      so we need to store the value 32 (not 31, as we need the zero
      as well), hence six bits.  */
   unsigned align : 6;
+  /* TYPE_STRING_FLAG for INTEGER_TYPE and ARRAY_TYPE.
+     TYPE_CXX_ODR_P for RECORD_TYPE and UNION_TYPE.  */
+  unsigned string_flag : 1;
+  unsigned no_force_blk_flag : 1;
+
   unsigned warn_if_not_align : 6;
+  unsigned needs_constructing_flag : 1;
+  unsigned transparent_aggr_flag : 1;
+
+  unsigned contains_placeholder_bits : 2;
+  unsigned restrict_flag : 1;
   unsigned typeless_storage : 1;
   unsigned empty_flag : 1;
   unsigned indivisible_p : 1;
   unsigned no_named_args_stdarg_p : 1;
-  unsigned spare : 15;
+  unsigned spare : 9;

   alias_set_type alias_set;
   tree pointer_to;

  reply	other threads:[~2023-02-01  8:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-01  8:00 [Bug other/108623] New: " meissner at gcc dot gnu.org
2023-02-01  8:18 ` rguenth at gcc dot gnu.org [this message]
2023-02-01  8:21 ` [Bug middle-end/108623] " rguenth at gcc dot gnu.org
2023-02-01 10:16 ` rsandifo at gcc dot gnu.org
2023-02-01 16:48 ` meissner at gcc dot gnu.org
2023-02-01 17:32 ` segher at gcc dot gnu.org
2023-02-01 17:37 ` meissner at gcc dot gnu.org
2023-02-01 17:40 ` meissner at gcc dot gnu.org
2023-02-01 18:52 ` joseph at codesourcery dot com
2023-02-02  8:22 ` rguenther at suse dot de
2023-02-02  9:04 ` rsandifo at gcc dot gnu.org
2023-05-08 12:03 ` cvs-commit at gcc dot gnu.org
2023-05-08 12:05 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108623-4-1snZKRraVt@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).