public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/63962] New: [5 Regression][x86] Code pessimization after r217213
@ 2014-11-19 12:56 izamyatin at gmail dot com
  2014-11-19 13:30 ` [Bug tree-optimization/63962] " rguenth at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: izamyatin at gmail dot com @ 2014-11-19 12:56 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 63962
           Summary: [5 Regression][x86] Code pessimization after r217213
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: izamyatin at gmail dot com
            Target: x86

While investigating some performance regressions on 32 bits on trunk (just -O2
-m32) I noticed that after r217213 forward propagation makes code worse for
following testcase

struct TT
{
 int * c;
 int s;
} FF;

long
foo (int t1, int t2)
{
  unsigned int i, i1;
  static int *c, s;

  for (i = 0; i < t1; i++)
    {
      c = FF.c + FF.s - 1;
      s = (int)(*c--);

      for (i1 = 2; i1 < t2; i1++)
    s += (int)(*c--);
    }

  return s;
}

For r217212 I see in 068t.forwprop2

-----
<bb 3>:
  _8 = FF.c;
  _9 = FF.s;
  _10 = (sizetype) _9;
  _11 = _10 + 1073741823;
  _12 = _11 * 4;
  c.0_13 = _8 + _12;
  c = c.0_13;
  c.3_15 = c.0_13 + 4294967292;
  c = c.3_15;
  s.4_17 = *c.0_13;
  s = s.4_17;
  # DEBUG i1 => 2
  goto <bb 5>;
-----

while for r217213 code contains one more addition

-----                                           |
 <bb 3>:                                        |
  _8 = FF.c;                                    |
  _9 = FF.s;                                    |
  _10 = (sizetype) _9;                          |
  _11 = _10 + 1073741823;                       |
  _12 = _11 * 4;                                |
  c.0_13 = _8 + _12;                            |
  c = c.0_13;                                   |
  _31 = _12 + 4294967292;    <-------------------
  c.3_15 = _8 + _31;
  c = c.3_15;
  s.4_17 = *c.0_13;
  s = s.4_17;
  # DEBUG i1 => 2
  goto <bb 5>;

-----


Can try to cook runtime test if it is necessary.


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

end of thread, other threads:[~2014-11-20  9:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-19 12:56 [Bug tree-optimization/63962] New: [5 Regression][x86] Code pessimization after r217213 izamyatin at gmail dot com
2014-11-19 13:30 ` [Bug tree-optimization/63962] " rguenth at gcc dot gnu.org
2014-11-19 14:23 ` rguenth at gcc dot gnu.org
2014-11-20  9:27 ` rguenth at gcc dot gnu.org
2014-11-20  9:27 ` rguenth 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).