view gcc/testsuite/gcc.dg/tree-ssa/negate.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 "-O2 -fdump-tree-reassoc1" } */

int f (int a, int b)
{
  int x = -a;
  int y = b - x;
  return y;
}

/* We tested for reassociation to -(a + b) on the following which
   isn't a transform that makes things cheaper.  With reassoc
   no longer applying to types with undefined overflow we lost
   this transform.

int g (int a, int b)
{
  int x = -a;
  int y = x - b;
  return y;
}

*/

/* There should be an addition now.  */
/* { dg-final { scan-tree-dump-times "\\+" 1 "reassoc1"} } */