public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wschmidt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug tree-optimization/53438] New: [4.7 Regression] Bitfield store replaced with full-byte store
Date: Mon, 21 May 2012 15:23:00 -0000	[thread overview]
Message-ID: <bug-53438-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             Bug #: 53438
           Summary: [4.7 Regression] Bitfield store replaced with
                    full-byte store
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: wschmidt@gcc.gnu.org
              Host: powerpc64-linux
            Target: powerpc64-linux
             Build: powerpc64-linux


Created attachment 27461
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=27461
Reduced testcase

In the attached reduced testcase YarrPattern.ii, function void
JSC::Yarr::YarrPatternConstructor::atomParenthesesSubpatternBegin(bool) (struct
YarrPatternConstructor * const this, bool capture), the "capture" argument is
copied into a one-bit bitfield m_capture within an inlined constructor.  In
4.6, we get the proper read-modify-write code for the bitfield update.  In 4.7,
the value of capture is stored as a full byte instead.

In the 077t.cplxlower dump, we see:

<bb 8>:
  D.4581_14 = this_1(D)->m_alternative;
  D.3875.type = 7;
  D.3875.m_capture = capture_5(D);
  D.3875.m_invert = 0;
  ...

In 078t.sra:

<bb 8>:
  D.4581_14 = this_1(D)->m_alternative;
  SR.171_48 = 7;
  SR.172_47 = capture_5(D);
  SR.173_46 = 0;
  D.6531_55 = &MEM[(struct Vector *)D.4581_14].impl;
  MEM[(struct PatternTerm *)&t] = SR.171_48;
  MEM[(struct PatternTerm *)&t + 4B] = SR.172_47;
  t.m_invert = SR.173_46;
  ...

In 079t.copyrename3:

<bb 8>:
  D.4581_14 = this_1(D)->m_alternative;
  SR.171_48 = 7;
  capture_47 = capture_5(D);
  SR.173_46 = 0;
  D.6531_55 = &MEM[(struct Vector *)D.4581_14].impl;
  MEM[(struct PatternTerm *)&t] = SR.171_48;
  MEM[(struct PatternTerm *)&t + 4B] = capture_47;
  t.m_invert = SR.173_46;
  ...

In 149t.optimized:

<bb 9>:
  D.4581_14 = this_1(D)->m_alternative;
  D.6531_55 = &MEM[(struct Vector *)D.4581_14].impl;
  MEM[(struct PatternTerm *)&t] = 7;
  MEM[(struct PatternTerm *)&t + 4B] = capture_5(D);
  t.m_invert = 0;
  ...

The bitfield-ness of m_capture is lost along the way.  On powerpc64-linux, this
generates a store-byte instruction instead of a read-modify-write.

The reduced test doesn't show the correct code for 4.6 since the method in
question is discarded for whatever reason.  If needed, that can be seen in the
larger YarrPattern.orig.ii, also attached.

The regression remains in current trunk as well.

Sorry for the relatively large test, but delta couldn't reduce it further and
it didn't seem worthwhile to keep hacking on it by hand.


             reply	other threads:[~2012-05-21 15:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-21 15:23 wschmidt at gcc dot gnu.org [this message]
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
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@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).