view gcc/testsuite/gcc.dg/tree-ssa/pr77664.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

/* PR tree-optimization/77664 */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-reassoc1-details" } */

extern void foo (void);

/* { dg-final { scan-tree-dump-times "Optimizing range test \[^\n\r]* and comparison" 6 "reassoc1" } } */

__attribute__((noinline, noclone)) void
fn1 (long long int a, unsigned short b, int c)
{
  if (a >= 0 && c && a < b)
    foo ();
}

__attribute__((noinline, noclone)) void
fn2 (long long int a, unsigned short b, int c)
{
  if (a < 0 || c || a >= b)
    foo ();
}

__attribute__((noinline, noclone)) void
fn3 (long long int a, unsigned short b)
{
  if (a < 0 || b < a)
    foo ();
}

__attribute__((noinline, noclone)) void
fn4 (long long int a, unsigned short b)
{
  if (a <= b && a >= 0)
    foo ();
}

__attribute__((noinline, noclone)) void
fn5 (long long int a, unsigned short b)
{
  if (a < 0 | a > b)
    foo ();
}

__attribute__((noinline, noclone)) void
fn6 (long long int a, unsigned short b)
{
  if (b >= a & a >= 0)
    foo ();
}