On Tue, Aug 14, 2012 at 2:11 PM, William J. Schmidt
<wschm...@linux.vnet.ibm.com> wrote:
> Replace the once vacuously true, and now vacuously false, test for
> existence of a conditional move instruction for a given mode, with one
> that actually checks what it's supposed to.  Add a test case so we don't
> miss such things in future.
>
> The test is powerpc-specific.  It would be good to have an i386 version
> of the test as well, if someone can help with that.
>
> Bootstrapped and tested on powerpc64-unknown-linux-gnu with no new
> regressions.  Ok for trunk?

Here is one which can go into gcc.target/mips :
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-phiopt-details" } */

typedef struct s {
  int v;
  int b;
  struct s *l;
  struct s *r;
} S;


int foo(S *s)
{
  S *this;
  S *next;

  this = s;
  if (this->b)
    next = this->l;
  else
    next = this->r;

  return next->v;
}

/* { dg-final { scan-tree-dump "Hoisting adjacent loads" "phiopt1" } } */
/* { dg-final { cleanup-tree-dump "phiopt1" } } */

Reply via email to