view gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children 1830386684a0
line wrap: on
line source

/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-* riscv*-*-* } } } } }  */
/* { dg-additional-options "-O2 -fdump-tree-vrp-details" }  */
/* { dg-additional-options "-mbranch-cost=2" { target i?86-*-* x86_64-*-* } }  */
/* { dg-final { scan-tree-dump-times "Threaded jump" 8 "vrp1" } }  */

void foo (void);
void bar (void);
void blah (void);

/* One jump threaded here.  */

void
baz_1 (int a, int b, int c)
{
  if (a && b)
    foo ();
  if (!b && c)
    bar ();
}

/* One jump threaded here.  */

void
baz_2 (int a, int b, int c)
{
  if (a && b)
    foo ();
  if (b || c)
    bar ();
}

/* One jump threaded here.  */

void
baz_3 (int a, int b, int c)
{
  if (a && b > 10)
    foo ();
  if (b < 5 && c)
    bar ();
}

/* Two jumps threaded here.  */

void
baz_4 (int a, int b, int c)
{
  if (a && b)
    {
      foo ();
      if (c)
        bar ();
    }
  if (b && c)
    blah ();
}

/* Two jumps threaded here.  */

void
baz_5 (int a, int b, int c)
{
  if (a && b)
    {
      foo ();
      if (c)
        bar ();
    }
  if (!b || !c)
    blah ();
}

/* One jump threaded here.  */

void
baz_6 (int a, int b, int c)
{
  if (a == 39 && b == 41)
    foo ();
  if (c == 12 || b == 41)
    bar ();
}