This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/63962] New: [5 Regression][x86] Code pessimization after r217213


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]