2014-07-29 Ed Smith-Rowland <3dw4rd@verizon.net>
[official-gcc.git] / gcc / testsuite / gcc.dg / pr50717-1.c
blobafbe542a2be3ea19304f59a2bf8251b83b418de0
1 /* PR tree-optimization/50717 */
2 /* Ensure that widening multiply-and-accumulate is not used where integer
3 type promotion or users' casts should prevent it. */
5 /* { dg-options "-O2 -fdump-tree-widening_mul" } */
7 long long
8 f (unsigned int a, char b, long long c)
10 return (a * b) + c;
13 int
14 g (short a, short b, int c)
16 return (short)(a * b) + c;
19 int
20 h (char a, char b, int c)
22 return (char)(a * b) + c;
25 /* { dg-final { scan-tree-dump-times "WIDEN_MULT_PLUS_EXPR" 0 "widening_mul" } } */
26 /* { dg-final { cleanup-tree-dump "widening_mul" } } */