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/47392] New: [4.6 Regression] PRE opportunity no longer found


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

           Summary: [4.6 Regression] PRE opportunity no longer found
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: tree-optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: rguenth@gcc.gnu.org


struct A
{
  int i;
};

struct B
{
  struct A a[2];
};

int i = 1;
struct B b = { 0, 3 };

static void
test ()
{
  if (b.a[0].i != i)            // <- with this
    {
      int t = b.a[0].i;
      b.a[0] = b.a[1];
      b.a[1].i = t;
    }

  if (b.a[1].i == i)
    __builtin_abort ();

  if (b.a[0].i == 0)            // <- partially redundant
    __builtin_abort ();
}

int
main ()
{
  test ();
  return 0;
}

no longer finds the PRE b.a[0].i


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