RISC-V: Add testcases for vector truncate after .SAT_SUB
[official-gcc.git] / gcc / testsuite / gcc.dg / tree-ssa / slsr-8.c
blob479f40f93de7112b963a7d9eda89658dfbe4434a
1 /* Verify straight-line strength reduction for simple pointer subtraction. */
3 /* { dg-do compile } */
4 /* { dg-options "-O3 -fdump-tree-optimized" } */
6 int*
7 f (int s, int *c, int *d)
9 int a1, a2, a3, *x1, *x2, *x3;
11 a1 = 2 * s;
12 x1 = c - a1;
13 a2 = 4 * s;
14 x2 = c - a2;
15 a3 = 6 * s;
16 x3 = c - a3;
17 return x1 == d ? x2 : x3;
20 /* Note that since some branch prediction heuristics changed, the
21 calculations of x2 and x3 are pushed downward into the legs
22 of the conditional, changing the code presented to SLSR.
23 However, this proves to be a useful test for introducing an
24 initializer with a cast, so we'll keep it as is. */
26 /* There are 5 ' * ' instances in the decls (since "int * iftmp.0;" is
27 added), 2 parms, 3 in the code, and the return value. The second one
28 in the code may be a widening multiply (for example, on AArch64). */
29 /* { dg-final { scan-tree-dump-times " w?\\* " 10 "optimized" } } */