2 /* { dg-options "-O2 -ftree-pre -fno-tree-loop-im -fgcse-sm -fdump-rtl-store_motion" } */
4 /* tree-pre moves the *sum load out of the loop. ftree-loop-im moves the *sum
5 store out of the loop, so we disable it, to allow fgcse-sm to do it
10 void __attribute__((noinline
))
11 f (unsigned int *__restrict__ a
, unsigned int *__restrict__ sum
, unsigned int n
)
14 for (i
= 0; i
< n
; ++i
)
21 unsigned int a
[] = { 1, 10, 100 };
31 /* Check that -fgcse-sm did something for f. */
32 /* { dg-final { scan-rtl-dump "STORE_MOTION of f, .* basic blocks, 1 insns deleted, 1 insns created" "store_motion" } } */