view gcc/testsuite/gcc.dg/pr19105.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
line wrap: on
line source

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

enum e
{
  a, b, c, d, e, f, g, h
};

int range1 (enum e v, int x)
{
  return x && v != c && v != d && v != e;
}

int range2 (enum e v, int x)
{
  return x && (v != c && v != d && v != e);
}

/* { dg-final { scan-tree-dump-times "Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 4.\[\n\r\]* into|Optimizing range tests v_\[0-9\]*.D. -.2, 2. and -.3, 3. and -.4, 4.\[\n\r\]* into" 1 "reassoc1" } } */