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 tree-optimization/53438] [4.7/4.8 Regression] Bitfield store replaced with full-byte store
Date: Tue, 22 May 2012 12:41:00 -0000	[thread overview]
Message-ID: <bug-53438-4-zEsvQ8A8VC@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-53438-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53438

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |rguenth at gcc dot gnu.org
                   |gnu.org                     |

--- Comment #6 from Richard Guenther <rguenth at gcc dot gnu.org> 2012-05-22 11:07:15 UTC ---
I think the following should fix it:

Index: gcc/tree-sra.c
===================================================================
--- gcc/tree-sra.c      (revision 187767)
+++ gcc/tree-sra.c      (working copy)
@@ -1001,9 +1001,10 @@ build_access_from_expr_1 (tree expr, gim
@@ -2096,9 +2097,12 @@ analyze_access_subtree (struct access *r
          && (TREE_CODE (root->type) != INTEGER_TYPE
              || TYPE_PRECISION (root->type) != root->size)
          /* But leave bitfield accesses alone.  */
-         && (root->offset % BITS_PER_UNIT) == 0)
+         && (TREE_CODE (root->expr) != COMPONENT_REF
+             || !DECL_BIT_FIELD (TREE_OPERAND (root->expr, 1))))
        {
          tree rt = root->type;
+         gcc_assert ((root->offset % BITS_PER_UNIT) == 0
+                     && (root->size % BITS_PER_UNIT) == 0);
          root->type = build_nonstandard_integer_type (root->size,
                                                       TYPE_UNSIGNED (rt));
          root->expr = build_ref_for_offset (UNKNOWN_LOCATION,


can you verify that, thus give it a bootstrap & regtest run?


  parent reply	other threads:[~2012-05-22 12:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 15:23 [Bug tree-optimization/53438] New: [4.7 " wschmidt at gcc dot gnu.org
2012-05-21 15:19 ` [Bug tree-optimization/53438] " wschmidt at gcc dot gnu.org
2012-05-21 15:22 ` wschmidt at gcc dot gnu.org
2012-05-22  5:35 ` [Bug tree-optimization/53438] [4.7/4.8 " pinskia at gcc dot gnu.org
2012-05-22  5:36 ` pinskia at gcc dot gnu.org
2012-05-22  7:18 ` pinskia at gcc dot gnu.org
2012-05-22 10:03 ` rguenth at gcc dot gnu.org
2012-05-22 10:50 ` rguenth at gcc dot gnu.org
2012-05-22 12:41 ` rguenth at gcc dot gnu.org [this message]
2012-05-22 13:19 ` wschmidt at gcc dot gnu.org
2012-05-22 18:22 ` wschmidt at gcc dot gnu.org
2012-05-23  7:15 ` rguenther at suse dot de
2012-05-23 12:36 ` wschmidt at gcc dot gnu.org
2012-05-23 13:10 ` rguenther at suse dot de
2012-05-23 17:48 ` wschmidt at gcc dot gnu.org
2012-05-25 15:38 ` jakub at gcc dot gnu.org
2012-05-25 15:49 ` wschmidt at gcc dot gnu.org
2012-05-28 14:03 ` wschmidt at gcc dot gnu.org
2012-05-28 14:09 ` wschmidt at gcc dot gnu.org
2012-05-28 14:28 ` jakub at gcc dot gnu.org
2012-05-28 14:48 ` jakub at gcc dot gnu.org
2012-05-28 23:07 ` wschmidt 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-53438-4-zEsvQ8A8VC@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).