public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs
@ 2012-03-14 13:01 rguenth at gcc dot gnu.org
  2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-03-14 13:01 UTC (permalink / raw)
  To: gcc-bugs

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

             Bug #: 52584
           Summary: Fails to constant fold vector upper/lower half
                    BIT_FIELD_REFs
    Classification: Unclassified
           Product: gcc
           Version: 4.7.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: middle-end
        AssignedTo: rguenth@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org
            Target: x86_64-*-*


int main()
{
    int a = 1;
    typedef int v4si __attribute__ ((vector_size (8 * sizeof(int))));
    v4si x;
    v4si y;
    y = x + a;
    foo(y);
    return 0;
}

shows a missed optimization in how we fold BIT_FIELD_REFs that select
the upper/lower part of a vector:

<bb 2>:
  D.1719_9 = BIT_FIELD_REF <x_4(D), 128, 0>;
  D.1721_10 = BIT_FIELD_REF <{ 1, 1, 1, 1, 1, 1, 1, 1 }, 128, 0>;
  D.1722_11 = D.1719_9 + D.1721_10;
  D.1723_12 = BIT_FIELD_REF <x_4(D), 128, 128>;
  D.1725_13 = BIT_FIELD_REF <{ 1, 1, 1, 1, 1, 1, 1, 1 }, 128, 128>;
  D.1726_14 = D.1723_12 + D.1725_13;
  y_5 = {D.1722_11, D.1726_14};
  foo (y_5);
  return 0;

we should have constant-folded D.1721_10 and D.1725_13.


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

end of thread, other threads:[~2012-05-19  6:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-03-14 13:01 [Bug middle-end/52584] New: Fails to constant fold vector upper/lower half BIT_FIELD_REFs rguenth at gcc dot gnu.org
2012-03-14 15:35 ` [Bug middle-end/52584] " rguenth at gcc dot gnu.org
2012-03-16 13:33 ` rguenth at gcc dot gnu.org
2012-03-16 14:54 ` rguenth at gcc dot gnu.org
2012-03-16 18:46 ` rguenth at gcc dot gnu.org
2012-05-19  7:59 ` davem 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).