view gcc/testsuite/gcc.dg/pr24574.c @ 131:84e7813d76e9

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

/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-phiopt2" } */

int f0(int i)
{
  if (i == 0) return 0;
  return i/10;
}
int f1(int i)
{
  return i?i/10:0;
}

int f2(int i)
{
  if (i == 0) return 0;
  return i%10;
}
int f3(int i)
{
  return i?i%10:0;
}

int f4(int i)
{
  if (i == 0) return 0;
  return i<<10;
}
int f5(int i)
{
  return i?i<<10:0;
}

/* We should if-convert all functions to carry out the operation
   unconditionally.  */
/* { dg-final { scan-tree-dump-not "= PHI" "phiopt2" } } */