public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/53438] New: [4.7 Regression] Bitfield store replaced with full-byte store
@ 2012-05-21 15:23 wschmidt at gcc dot gnu.org
  2012-05-21 15:19 ` [Bug tree-optimization/53438] " wschmidt at gcc dot gnu.org
                   ` (20 more replies)
  0 siblings, 21 replies; 22+ messages in thread
From: wschmidt at gcc dot gnu.org @ 2012-05-21 15:23 UTC (permalink / raw)
  To: gcc-bugs

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.


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

end of thread, other threads:[~2012-05-28 22:33 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-21 15:23 [Bug tree-optimization/53438] New: [4.7 Regression] Bitfield store replaced with full-byte store 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
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

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).