view gcc/testsuite/gcc.dg/pr50717-1.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/50717  */
/* Ensure that widening multiply-and-accumulate is not used where integer
   type promotion or users' casts should prevent it.  */

/* { dg-options "-O2 -fdump-tree-widening_mul" } */

long long
f (unsigned int a, char b, long long c)
{
  return (a * b) + c;
}

int
g (short a, short b, int c)
{
  return (short)(a * b) + c;
}

int
h (char a, char b, int c)
{
  return (char)(a * b) + c;
}

/* { dg-final { scan-tree-dump-times "WIDEN_MULT_PLUS_EXPR" 0 "widening_mul" } } */